selecting conversation and expanding the window nicely

This commit is contained in:
talksik
2022-03-19 20:49:34 -04:00
parent 2a0f74435b
commit b656e9d3a9
6 changed files with 50 additions and 5 deletions
+10 -4
View File
@@ -1,6 +1,6 @@
import { BrowserWindow, app, ipcMain } from "electron";
import Channels, { Dimensions } from "./electron/constants";
import Channels from "./electron/constants";
import { handleLogin } from "./electron/handleLogin";
import store from "./electron/store";
@@ -23,8 +23,7 @@ export let browserWindow: BrowserWindow;
const createWindow = (): void => {
// Create the browser window.
browserWindow = new BrowserWindow({
height: 900,
width: 900,
...Dimensions.default,
webPreferences: {
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
sandbox: true,
@@ -51,7 +50,7 @@ app
await handleLogin();
});
// IPC listener
// access storage/cookies
ipcMain.on("electron-store-set", async (event, key, val) => {
store.set(key, val);
});
@@ -59,6 +58,13 @@ app
const result = await store.get(val);
return result;
});
// dynamically changing the window bounds
ipcMain.on(Channels.RESIZE_WINDOW, (event, arg) => {
const { width, height } = arg;
browserWindow.setSize(width, height, true);
});
});
// Quit when all windows are closed, except on macOS. There, it's common