1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 13:40:06 +00:00

Added logging.

This commit is contained in:
Todd Martin
2025-03-31 18:09:27 -04:00
parent 7a3fb9bd8b
commit 597e70a4e4
2 changed files with 11 additions and 0 deletions

View File

@@ -215,6 +215,7 @@ export class Main {
this.desktopSettingsService,
this.messagingService,
this.biometricsService,
this.logService,
);
messageSubject.asObservable().subscribe((message) => {
@@ -246,6 +247,7 @@ export class Main {
this.desktopSettingsService,
this.messagingService,
this.biometricsService,
this.logService,
);
this.desktopCredentialStorageListener = new DesktopCredentialStorageListener(
@@ -309,7 +311,10 @@ export class Main {
},
]);
if (await firstValueFrom(this.desktopSettingsService.startToTray$)) {
this.logService.info("startToTray is enabled");
await this.trayMain.hideToTray();
} else {
this.logService.info("startToTray is not enabled");
}
this.powerMonitorMain.init();
await this.updaterMain.init();

View File

@@ -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 { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { BiometricsService } from "@bitwarden/key-management";
@@ -28,6 +29,7 @@ export class TrayMain {
private desktopSettingsService: DesktopSettingsService,
private messagingService: MessagingService,
private biometricService: BiometricsService,
private logService: LogService,
) {
if (process.platform === "win32") {
this.icon = path.join(__dirname, "/images/icon.ico");
@@ -119,9 +121,13 @@ export class TrayMain {
}
async hideToTray() {
this.logService.info("In hideToTray");
this.showTray();
this.logService.info("After showTray");
if (this.windowMain.win != null) {
this.logService.info("Hiding window");
this.windowMain.win.hide();
this.logService.info("After hiding window");
}
if (this.isDarwin() && !(await firstValueFrom(this.desktopSettingsService.alwaysShowDock$))) {
this.hideDock();