-
Notifications
You must be signed in to change notification settings - Fork 1
/
splash.js
37 lines (31 loc) · 1001 Bytes
/
splash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
let { PythonShell } = require("python-shell");
const { ipcRenderer } = require("electron");
require('v8-compile-cache');
var path = require("path");
function checkLogin() {
console.log("checking");
var options = {
// pythonPath: 'C:\\Users\\Prasanna\\AppData\\Local\\Programs\\Python\\Python37\\python',
pythonPath: 'python',
scriptPath: path.join(__dirname, "python/"),
args: ["isSignedIn"],
};
let pyshell = new PythonShell("main.py", options);
pyshell.on("message", function (message) {
if (message === "true") {
ipcRenderer.send("open-home-window", "home");
console.log("ipc message sent");
console.log("Logedin");
window.close()
}
else if (message === "false"){
ipcRenderer.send("open-login-window", "home");
console.log("ipc message sent");
console.log("Logedin");
window.close()
}
else {
console.log(message);
}
});
}