basic file exploration and bugfixes

This commit is contained in:
RafayAhmad7548 2025-07-27 09:56:46 +05:00
parent 8d7c90bbac
commit 0740c4b82d
5 changed files with 124 additions and 4 deletions

View file

@ -39,7 +39,10 @@ class _AddServerModalState extends State<AddServerModal> {
_connection.isEncryptionEnabled = widget.initialState?.isEncryptionEnabled;
_connection.isDefault = widget.initialState?.isDefault;
_privateKeyFileController.text = widget.initialState?.privateKey ?? '';
_connection.privateKey = widget.initialState?.privateKey;
_passwordController.text = widget.initialState?.password ?? '';
_fileSelected = true;
_isPrivateKeyValid = true;
}
}
@ -135,7 +138,6 @@ class _AddServerModalState extends State<AddServerModal> {
}
}
catch (e) {
print('bonga');
setState(() {
_fileSelected = true;
_showPrivateKey = true;
@ -168,7 +170,7 @@ class _AddServerModalState extends State<AddServerModal> {
if (_privateKeyFileController.text.isEmpty && _passwordController.text.isEmpty) {
return 'At least provide one of these';
}
if (!_isPrivateKeyValid) {
if (_privateKeyFileController.text.isNotEmpty && !_isPrivateKeyValid) {
return 'Invalid private key file';
}
return null;