summaryrefslogtreecommitdiff
path: root/assets/load.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 /assets/load.js
parent1a3ff5e4f8bbd4cf35093cdb42d0d93ca635c91e (diff)
downloadbits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.gz
bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.tar.bz2
bits-client-5abe8cba55965f70e07e1163239bcc9d797c864a.zip
Bye bye desktop app
Diffstat (limited to 'assets/load.js')
-rw-r--r--assets/load.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/assets/load.js b/assets/load.js
new file mode 100644
index 0000000..fc3f464
--- /dev/null
+++ b/assets/load.js
@@ -0,0 +1,23 @@
+window.onload = async () => {
+ if (!isNodeJS) {
+ document.getElementById("mobile-css").removeAttribute("disabled");
+ }
+
+ setTimeout(async () => {
+ loginStatus = JSON.parse(await (await window.fetch("https://money-v1.equestria.dev/Authentication/Test/")).text()).status;
+ if (loginStatus === 1) {
+ if (isNodeJS) {
+ console.info("Starting authentication procedure (Electron)");
+ const { ipcRenderer } = require('electron');
+ ipcRenderer.send("login");
+ } else {
+ console.info("Starting authentication procedure (Mobile)");
+ location.href = "https://money-v1.equestria.dev/Authentication/Mobile/"
+ }
+ } else {
+ console.info("Authenticated successfully");
+
+ await refresh();
+ }
+ }, 1000)
+} \ No newline at end of file