Add account switching error handling for ssh agent

This commit is contained in:
Bernd Schoolmann 2024-11-21 15:27:30 +01:00
parent 6435845438
commit 41e25be5b9
No known key found for this signature in database
1 changed files with 4 additions and 4 deletions

View File

@ -163,14 +163,14 @@ export class SshAgentService implements OnDestroy {
)
.subscribe();
this.accountService.activeAccount$
.pipe(skip(1), takeUntil(this.destroy$))
.subscribe((account) => {
this.accountService.activeAccount$.pipe(skip(1), takeUntil(this.destroy$)).subscribe({
next: (account) => {
this.logService.info("Active account changed, clearing SSH keys");
ipc.platform.sshAgent
.clearKeys()
.catch((e) => this.logService.error("Failed to clear SSH keys", e));
});
},
});
combineLatest([
timer(0, this.SSH_REFRESH_INTERVAL),