summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-07-09 15:22:44 +0200
committerMinteck <contact@minteck.org>2022-07-09 15:22:44 +0200
commit5abe8cba55965f70e07e1163239bcc9d797c864a (patch)
treeeb29933d2d5420c134f21a941cceb1d361c53b1d /index.js
parent1a3ff5e4f8bbd4cf35093cdb42d0d93ca635c91e (diff)
downloadbits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.gz
bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.bz2
bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.zip
Bye bye desktop app
Diffstat (limited to 'index.js')
-rw-r--r--index.js75
1 files changed, 0 insertions, 75 deletions
diff --git a/index.js b/index.js
deleted file mode 100644
index 752ca23..0000000
--- a/index.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// noinspection HttpUrlsUsage
-
-const { app, BrowserWindow, ipcMain } = require('electron');
-
-const createWindow = () => {
- global.mainWindow = new BrowserWindow({
- width: 1200,
- height: 700,
- title: "Bits",
- fullscreenable: false,
- backgroundColor: "#222",
- webPreferences: {
- nodeIntegration: true,
- nodeIntegrationInSubFrames: true,
- contextIsolation: false,
- enableRemoteModule: true
- }
- })
-
- mainWindow.loadFile('index.html')
- mainWindow.menuBarVisible = false;
-}
-
-process.on('uncaughtException', (error) => {
- console.error(error);
-})
-
-app.whenReady().then(() => {
- createWindow()
-})
-
-app.on('window-all-closed', () => {
- app.quit()
-})
-
-global.authenticationSucceeded = false;
-
-ipcMain.on("login", () => {
- const loginWindow = new BrowserWindow({
- width: 500,
- height: 800,
- parent: mainWindow,
- title: "Bits",
- show: false,
- fullscreenable: false,
- backgroundColor: "#fff",
- webPreferences: {
- nodeIntegration: false,
- nodeIntegrationInSubFrames: false,
- contextIsolation: true,
- enableRemoteModule: false
- }
- });
-
- global.authenticationCheckInterval = setInterval(() => {
- let url = loginWindow.webContents.getURL();
-
- if (url.startsWith("https://auth.equestria.horse") || url.includes("Disallowed")) {
- loginWindow.show();
- }
-
- if (url === "https://money-v1.equestria.dev/Authentication/Success/" || url === "https://money-v2.equestria.dev/Authentication/Success/") {
- clearInterval(authenticationCheckInterval);
- global.authenticationSucceeded = true;
- loginWindow.close();
- mainWindow.webContents.reload();
- }
- }, 100);
-
- loginWindow.on('close', () => {
- if (!authenticationSucceeded) mainWindow.close();
- })
-
- loginWindow.loadURL("https://money.equestria.dev/Authentication/Start");
-}) \ No newline at end of file