trying stuff and setting up auto

This commit is contained in:
talksik
2022-05-28 03:08:25 -05:00
parent 2def3fde91
commit c21c80b8f7
6 changed files with 216 additions and 4 deletions
+10
View File
@@ -1,6 +1,7 @@
import { app, BrowserWindow, ipcMain, Display, screen } from 'electron';
import Channels, { DEFAULT_APP_PRESET, DimensionChangeRequest } from './electron/constants';
import { handleGoogleLogin } from './electron/handleLogin';
// This allows TypeScript to pick up the magic constant that's auto-generated by Forge's Webpack
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
// whether you're running in development or production).
@@ -25,6 +26,8 @@ const createWindow = (): void => {
...DEFAULT_APP_PRESET,
webPreferences: {
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
nodeIntegration: true,
contextIsolation: false,
},
// titleBarStyle: "hiddenInset",
frame: false,
@@ -46,6 +49,13 @@ const createWindow = (): void => {
app
.whenReady()
.then(createWindow)
.then(() => {
// activate login
ipcMain.on(Channels.ACTIVATE_LOG_IN, async (event, arg) => {
console.log('initiating log in');
await handleGoogleLogin();
});
})
.then(() => {
// dynamically changing the window bounds
ipcMain.on(Channels.RESIZE_WINDOW, (event, req: DimensionChangeRequest) => {