1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

fix(desktop): save zoom level to state when it is adjusted (#15406)

This commit is contained in:
Addison Beck
2025-07-01 14:03:08 -04:00
committed by GitHub
parent 832e4b16f0
commit c9aa8498c7

View File

@@ -295,6 +295,15 @@ export class WindowMain {
this.win.webContents.zoomFactor = this.windowStates[mainWindowSizeKey].zoomFactor ?? 1.0;
});
// Persist zoom changes immediately when user zooms in/out or resets zoom
// We can't depend on higher level web events (like close) to do this
// because locking the vault resets window state.
this.win.webContents.on("zoom-changed", async () => {
const newZoom = this.win.webContents.zoomFactor;
this.windowStates[mainWindowSizeKey].zoomFactor = newZoom;
await this.desktopSettingsService.setWindow(this.windowStates[mainWindowSizeKey]);
});
if (this.windowStates[mainWindowSizeKey].isMaximized) {
this.win.maximize();
}