diff --git a/ShhShell/SSH/SSHHandler.swift b/ShhShell/SSH/SSHHandler.swift index 9a9c30a..3f2cfc7 100644 --- a/ShhShell/SSH/SSHHandler.swift +++ b/ShhShell/SSH/SSHHandler.swift @@ -55,8 +55,8 @@ class SSHHandler: @unchecked Sendable, ObservableObject { try connect() } catch { print("error in connect \(error.localizedDescription)") + return } - guard connected else { return } try? authWithNone() getAuthMethods() diff --git a/ShhShell/Views/ConnectionView.swift b/ShhShell/Views/ConnectionView.swift index d464fb6..db2c0be 100644 --- a/ShhShell/Views/ConnectionView.swift +++ b/ShhShell/Views/ConnectionView.swift @@ -108,6 +108,7 @@ struct ConnectionView: View { .alert("Hostkey changed", isPresented: $hostKeyChangedAlert) { Button("Accept New Hostkey", role: .destructive) { hostsManager.updateHost(handler.host) + handler.go() } Button("Disconnect", role: .cancel) {