1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 05:53:42 +00:00

[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

(cherry picked from commit 8717d79d51)
This commit is contained in:
Bernd Schoolmann
2025-01-14 15:50:54 +01:00
parent 83ee64ba1d
commit 02a4f61890

View File

@@ -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.