1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[PM-5796] Improve desktop biometric browser integration error handling (#7727)

* Re-register native messaging host integrations on startup

* Check for errors when generating the manifests

* Add log to component

* Switch to Promise.all

* Add injectable service
This commit is contained in:
Daniel García
2024-04-18 17:40:39 +02:00
committed by GitHub
parent adb1ee3d38
commit 912b7c136e
9 changed files with 213 additions and 156 deletions

View File

@@ -291,12 +291,20 @@ export class Main {
this.powerMonitorMain.init();
await this.updaterMain.init();
if (
(await this.stateService.getEnableBrowserIntegration()) ||
(await firstValueFrom(
this.desktopAutofillSettingsService.enableDuckDuckGoBrowserIntegration$,
))
) {
const [browserIntegrationEnabled, ddgIntegrationEnabled] = await Promise.all([
this.stateService.getEnableBrowserIntegration(),
firstValueFrom(this.desktopAutofillSettingsService.enableDuckDuckGoBrowserIntegration$),
]);
if (browserIntegrationEnabled || ddgIntegrationEnabled) {
// Re-register the native messaging host integrations on startup, in case they are not present
if (browserIntegrationEnabled) {
this.nativeMessagingMain.generateManifests().catch(this.logService.error);
}
if (ddgIntegrationEnabled) {
this.nativeMessagingMain.generateDdgManifests().catch(this.logService.error);
}
this.nativeMessagingMain.listen();
}