feat: add desktop repo (#1071)
This commit is contained in:
16
packages/desktop/app/javascripts/Main/ZoomManager.ts
Normal file
16
packages/desktop/app/javascripts/Main/ZoomManager.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { BrowserWindow } from 'electron'
|
||||
import { Store, StoreKeys } from './Store'
|
||||
|
||||
export function initializeZoomManager(window: BrowserWindow, store: Store): void {
|
||||
window.webContents.on('dom-ready', () => {
|
||||
const zoomFactor = store.get(StoreKeys.ZoomFactor)
|
||||
if (zoomFactor) {
|
||||
window.webContents.zoomFactor = zoomFactor
|
||||
}
|
||||
})
|
||||
|
||||
window.on('close', () => {
|
||||
const zoomFactor = window.webContents.zoomFactor
|
||||
store.set(StoreKeys.ZoomFactor, zoomFactor)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user