mirror of
https://github.com/bitwarden/browser
synced 2026-01-08 03:23:50 +00:00
[PM-10741] Refactor biometrics interface & add dynamic status (#10973)
This commit is contained in:
@@ -6,6 +6,7 @@ import { app, BrowserWindow, Menu, MenuItemConstructorOptions, nativeImage, Tray
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { BiometricStateService, BiometricsService } from "@bitwarden/key-management";
|
||||
|
||||
import { DesktopSettingsService } from "../platform/services/desktop-settings.service";
|
||||
|
||||
@@ -23,6 +24,8 @@ export class TrayMain {
|
||||
private windowMain: WindowMain,
|
||||
private i18nService: I18nService,
|
||||
private desktopSettingsService: DesktopSettingsService,
|
||||
private biometricsStateService: BiometricStateService,
|
||||
private biometricService: BiometricsService,
|
||||
) {
|
||||
if (process.platform === "win32") {
|
||||
this.icon = path.join(__dirname, "/images/icon.ico");
|
||||
@@ -72,6 +75,10 @@ export class TrayMain {
|
||||
}
|
||||
});
|
||||
|
||||
win.on("restore", async () => {
|
||||
await this.biometricService.setShouldAutopromptNow(true);
|
||||
});
|
||||
|
||||
win.on("close", async (e: Event) => {
|
||||
if (await firstValueFrom(this.desktopSettingsService.closeToTray$)) {
|
||||
if (!this.windowMain.isQuitting) {
|
||||
|
||||
Reference in New Issue
Block a user