mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
fix(desktop): save zoom level to state when it is adjusted (#15406)
This commit is contained in:
@@ -295,6 +295,15 @@ export class WindowMain {
|
|||||||
this.win.webContents.zoomFactor = this.windowStates[mainWindowSizeKey].zoomFactor ?? 1.0;
|
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) {
|
if (this.windowStates[mainWindowSizeKey].isMaximized) {
|
||||||
this.win.maximize();
|
this.win.maximize();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user