koel/resources/assets/js/utils/app.ts
2022-04-15 16:24:30 +02:00

11 lines
291 B
TypeScript

// App (electron)-only methods
let mainWindow: any
if (KOEL_ENV === 'app') {
mainWindow = require('electron').remote.getCurrentWindow()
}
export const app = {
triggerMaximize: (): void =>
mainWindow && (mainWindow.isMaximized() ? mainWindow.unmaximize() : mainWindow.maximize())
}