aboutsummaryrefslogtreecommitdiff
path: root/src/modules/window.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/window.js')
-rw-r--r--src/modules/window.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/window.js b/src/modules/window.js
index 6cc573c..ebb0165 100644
--- a/src/modules/window.js
+++ b/src/modules/window.js
@@ -1,10 +1,11 @@
+const main_win = require("../win");
const ipcMain = require("electron").ipcMain;
let win = {};
// logs into the dev tools of the renderer
-win.log = (msg) => {
- ipcMain.emit("win-log", msg, msg);
+win.log = (...args) => {
+ main_win().send("log", ...args);
}
// this increments for every alert that's created, the ID is used to
@@ -20,7 +21,10 @@ win.alert = (msg) => {
resolve();
})
- ipcMain.emit("win-alert", msg, msg, alert_id);
+ main_win().send("alert", {
+ id: alert_id,
+ message: msg
+ })
})
}
@@ -37,7 +41,10 @@ win.confirm = (msg) => {
resolve(confirmed);
})
- ipcMain.emit("win-confirm", msg, msg, confirm_id);
+ main_win().send("confirm", {
+ message: msg,
+ id: confirm_id
+ })
})
}