fix: only start ssh agent if it's enabled (#13464)

closes #13150

Co-authored-by: Bernd Schoolmann <mail@quexten.com>
This commit is contained in:
Zihad 2025-06-09 20:05:34 +06:00 committed by GitHub
parent a421acc47a
commit b43e09ea6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,9 +63,16 @@ export class SshAgentService implements OnDestroy {
) {}
async init() {
if (!(await ipc.platform.sshAgent.isLoaded())) {
await ipc.platform.sshAgent.init();
}
this.desktopSettingsService.sshAgentEnabled$
.pipe(
concatMap(async (enabled) => {
if (!(await ipc.platform.sshAgent.isLoaded()) && enabled) {
await ipc.platform.sshAgent.init();
}
}),
takeUntil(this.destroy$),
)
.subscribe();
await this.initListeners();
}