mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-30 14:20:18 +08:00
fixed #5797 - verified host keys not saving
This commit is contained in:
parent
a2929309d9
commit
50304d151a
@ -32,8 +32,8 @@ export class HostKeyPromptModalComponent {
|
|||||||
this.modalInstance.close(true)
|
this.modalInstance.close(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptAndSave () {
|
async acceptAndSave () {
|
||||||
this.knownHosts.store(this.selector, this.digest)
|
await this.knownHosts.store(this.selector, this.digest)
|
||||||
this.accept()
|
this.accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +21,13 @@ export class SSHKnownHostsService {
|
|||||||
return this.config.store.ssh.knownHosts.find(x => x.host === selector.host && x.port === selector.port && x.type === selector.type) ?? null
|
return this.config.store.ssh.knownHosts.find(x => x.host === selector.host && x.port === selector.port && x.type === selector.type) ?? null
|
||||||
}
|
}
|
||||||
|
|
||||||
store (selector: KnownHostSelector, digest: string): void {
|
async store (selector: KnownHostSelector, digest: string): Promise<void> {
|
||||||
const existing = this.getFor(selector)
|
const existing = this.getFor(selector)
|
||||||
if (existing) {
|
if (existing) {
|
||||||
existing.digest = digest
|
existing.digest = digest
|
||||||
} else {
|
} else {
|
||||||
this.config.store.ssh.knownHosts.push({ ...selector, digest })
|
this.config.store.ssh.knownHosts.push({ ...selector, digest })
|
||||||
}
|
}
|
||||||
|
this.config.save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user