1
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-07-26 22:58:33 +00:00

error handling

This commit is contained in:
Eugene Pankov
2021-06-20 17:01:24 +02:00
parent 396d8d6122
commit 552991271f

@@ -64,14 +64,6 @@ export class EditConnectionModalComponent {
) )
async ngOnInit () { async ngOnInit () {
this.hasSavedPassword = !!await this.passwordStorage.loadPassword(this.connection)
this.connection.algorithms = this.connection.algorithms ?? {}
this.connection.scripts = this.connection.scripts ?? []
this.connection.auth = this.connection.auth ?? null
this.connection.privateKeys ??= []
this.useProxyCommand = !!this.connection.proxyCommand
for (const k of Object.values(SSHAlgorithmType)) { for (const k of Object.values(SSHAlgorithmType)) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!this.connection.algorithms[k]) { if (!this.connection.algorithms[k]) {
@@ -83,6 +75,18 @@ export class EditConnectionModalComponent {
this.algorithms[k][alg] = true this.algorithms[k][alg] = true
} }
} }
this.connection.algorithms = this.connection.algorithms ?? {}
this.connection.scripts = this.connection.scripts ?? []
this.connection.auth = this.connection.auth ?? null
this.connection.privateKeys ??= []
this.useProxyCommand = !!this.connection.proxyCommand
try {
this.hasSavedPassword = !!await this.passwordStorage.loadPassword(this.connection)
} catch (e) {
console.error('Could not check for saved password', e)
}
} }
async setPassword () { async setPassword () {