diff --git a/tabby-ssh/src/components/hostKeyPromptModal.component.ts b/tabby-ssh/src/components/hostKeyPromptModal.component.ts index 80586086..52644675 100644 --- a/tabby-ssh/src/components/hostKeyPromptModal.component.ts +++ b/tabby-ssh/src/components/hostKeyPromptModal.component.ts @@ -32,8 +32,8 @@ export class HostKeyPromptModalComponent { this.modalInstance.close(true) } - acceptAndSave () { - this.knownHosts.store(this.selector, this.digest) + async acceptAndSave () { + await this.knownHosts.store(this.selector, this.digest) this.accept() } diff --git a/tabby-ssh/src/services/sshKnownHosts.service.ts b/tabby-ssh/src/services/sshKnownHosts.service.ts index c56b41cb..e80ffd69 100644 --- a/tabby-ssh/src/services/sshKnownHosts.service.ts +++ b/tabby-ssh/src/services/sshKnownHosts.service.ts @@ -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 } - store (selector: KnownHostSelector, digest: string): void { + async store (selector: KnownHostSelector, digest: string): Promise { const existing = this.getFor(selector) if (existing) { existing.digest = digest } else { this.config.store.ssh.knownHosts.push({ ...selector, digest }) } + this.config.save() } }