From 8717d79d51ca5429ca336a9944afa7becb62af6c Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Tue, 14 Jan 2025 15:50:54 +0100 Subject: [PATCH] [PM-16918] Fix agent setting not disabling key usage (#12857) * Fix agent setting not disabling key usage * Cleanup * Change firstvaluefrom to withlatestfrom * Switch back to concatmap --- apps/desktop/src/platform/services/ssh-agent.service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/desktop/src/platform/services/ssh-agent.service.ts b/apps/desktop/src/platform/services/ssh-agent.service.ts index 726d28022e5..d4c7c5f460 100644 --- a/apps/desktop/src/platform/services/ssh-agent.service.ts +++ b/apps/desktop/src/platform/services/ssh-agent.service.ts @@ -83,6 +83,15 @@ export class SshAgentService implements OnDestroy { this.messageListener .messages$(new CommandDefinition("sshagent.signrequest")) .pipe( + withLatestFrom(this.desktopSettingsService.sshAgentEnabled$), + concatMap(async ([message, enabled]) => { + if (!enabled) { + await ipc.platform.sshAgent.signRequestResponse(message.requestId as number, false); + } + return { message, enabled }; + }), + filter(({ enabled }) => enabled), + map(({ message }) => message), withLatestFrom(this.authService.activeAccountStatus$), // This switchMap handles unlocking the vault if it is locked: // - If the vault is locked, we will wait for it to be unlocked.