EZPPLauncher/preload.js

20 lines
681 B
JavaScript
Raw Normal View History

2024-01-09 12:10:37 +00:00
const { Titlebar, TitlebarColor } = require("custom-electron-titlebar");
2024-01-11 00:00:43 +00:00
const { ipcRenderer } = require("electron");
2024-01-09 12:10:37 +00:00
window.addEventListener("DOMContentLoaded", () => {
const titlebar = new Titlebar({
backgroundColor: TitlebarColor.fromHex("#202020"),
itemBackgroundColor: TitlebarColor.fromHex("#202020"),
menu: null,
enableMnemonics: false,
maximizable: false,
});
});
2024-01-11 00:00:43 +00:00
window.addEventListener("login-attempt", async (e) => {
const loginResult = await ipcRenderer.invoke("ezpplauncher:login", {
username: e.detail.username,
password: e.detail.password,
});
window.dispatchEvent(new CustomEvent("login-result", { detail: loginResult }));
})