trying with the store and such

This commit is contained in:
talksik
2022-03-17 20:13:49 -04:00
parent 453121c987
commit 34fe8e0c29
21 changed files with 478 additions and 35758 deletions
+12 -4
View File
@@ -2,11 +2,13 @@ import { BrowserWindow, app, ipcMain } from "electron";
import Channels from "./electron/constants";
import { handleLogin } 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).
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: any;
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require("electron-squirrel-startup")) {
@@ -24,7 +26,7 @@ const createWindow = (): void => {
height: 600,
width: 800,
webPreferences: {
nodeIntegration: true,
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
},
});
@@ -42,12 +44,18 @@ app
.whenReady()
.then(createWindow)
.then(() => {
console.log("hahha");
// End of the file
ipcMain.on(Channels.ACTIVATE_LOG_IN, async (event, arg) => {
console.log("initiating log in");
await handleLogin();
});
// IPC listener
ipcMain.on("electron-store-get", async (event, val) => {
event.returnValue = store.get(val);
});
ipcMain.on("electron-store-set", async (event, key, val) => {
store.set(key, val);
});
});
// Quit when all windows are closed, except on macOS. There, it's common