FIX (sftp): Fix initial value in case of private key

This commit is contained in:
Rostislav Dugin
2025-12-29 15:47:00 +03:00
parent 6ad38228ce
commit 9853ac425a

View File

@@ -14,7 +14,7 @@ export function EditSFTPStorageComponent({ storage, setStorage, setUnsaved }: Pr
const hasAdvancedValues = !!storage?.sftpStorage?.skipHostKeyVerify;
const [showAdvanced, setShowAdvanced] = useState(hasAdvancedValues);
const initialAuthMethod = storage?.sftpStorage?.privateKey !== undefined ? 'privateKey' : 'password';
const initialAuthMethod = storage?.sftpStorage?.privateKey ? 'privateKey' : 'password';
const [authMethod, setAuthMethod] = useState<'password' | 'privateKey'>(initialAuthMethod);
return (