1
1
mirror of https://github.com/Eugeny/tabby.git synced 2025-01-01 15:11:16 +03:00

error handling

This commit is contained in:
Eugene Pankov 2021-06-20 17:01:24 +02:00
parent 396d8d6122
commit 552991271f
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -64,14 +64,6 @@ export class EditConnectionModalComponent {
)
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)) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!this.connection.algorithms[k]) {
@ -83,6 +75,18 @@ export class EditConnectionModalComponent {
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 () {