nice flow not buggy with listeners doubling up

This commit is contained in:
talksik
2022-05-28 10:15:53 -05:00
parent 84b67c2c62
commit d843e0f130
7 changed files with 175 additions and 35 deletions
+11
View File
@@ -2,6 +2,8 @@ import { app, BrowserWindow, ipcMain, Display, screen } from 'electron';
import Channels, { DEFAULT_APP_PRESET, DimensionChangeRequest } from './electron/constants';
import { handleGoogleLogin } from './electron/handleLogin';
import store from './electron/store';
// 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).
@@ -48,6 +50,15 @@ app
.whenReady()
.then(createWindow)
.then(() => {
// access storage/cookies
ipcMain.on('electron-store-set', async (event, key, val) => {
store.set(key, val);
});
ipcMain.handle('electron-store-get', async (event, val) => {
const result = await store.get(val);
return result;
});
// activate login
ipcMain.on(Channels.ACTIVATE_LOG_IN, async (event, arg) => {
console.log('initiating log in');