diff --git a/main/main.ts b/main/main.ts index cc9b444..50ae4f3 100644 --- a/main/main.ts +++ b/main/main.ts @@ -13,6 +13,10 @@ class Main { ipcMain.handle("setOpenAtLogin", (e, flag: boolean) => { app.setLoginItemSettings({ openAtLogin: flag }); }); + ipcMain.handle("relaunch",()=>{ + app.relaunch(); + app.quit(); + }) ipcMain.handle("activeSubWindow", (e) => { let wins = BrowserWindow.getAllWindows(); for (let item of wins) { diff --git a/package.json b/package.json index 3c9ed32..f7bbbcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calendar", - "version": "1.0.1", + "version": "1.0.2", "description": "A easy to use calendar desktop software", "main": "main.js", "scripts": { diff --git a/render/DataMonth.ts b/render/DataMonth.ts index 60449b9..efe1300 100644 --- a/render/DataMonth.ts +++ b/render/DataMonth.ts @@ -55,7 +55,8 @@ class DataMonth { let span = end.getTime() - this.curDate.getTime() clearTimeout(this.idTimerToTomarrow); this.idTimerToTomarrow = setTimeout(()=>{ - window.location.reload() + let { ipcRenderer } = require("electron"); + ipcRenderer.invoke("relaunch") },span) } async init() {