-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
102 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const notification = document.getElementById("notification"); | ||
const message = document.getElementById("message"); | ||
const restartButton = document.getElementById("restart-button"); | ||
window.ipcRenderer.on("checking-for-update", () => { | ||
window.ipcRenderer.removeAllListeners("checking-for-update"); | ||
message.innerText = "Checking for updates..."; | ||
notification.classList.remove("hidden"); | ||
}); | ||
// window.ipcRenderer.on("update-not-available", () => { | ||
// window.ipcRenderer.removeAllListeners("update-not-available"); | ||
// message.innerText = "No updates available"; | ||
// notification.classList.remove("hidden"); | ||
// setTimeout(() => { | ||
// notification.classList.add("hidden"); | ||
// }, 2000); | ||
// }); | ||
window.ipcRenderer.on("download-progress", (e, text) => { | ||
message.innerText = text; | ||
notification.classList.remove("hidden"); //tnrtodo comment this out | ||
}); | ||
window.ipcRenderer.on("error", (e, text) => { | ||
window.ipcRenderer.removeAllListeners("error"); | ||
message.innerText = "Error updating: " + text; | ||
}); | ||
window.ipcRenderer.on("update_available", () => { | ||
window.ipcRenderer.removeAllListeners("update_available"); | ||
message.innerText = "A new update is available. Downloading now..."; | ||
notification.classList.remove("hidden"); | ||
}); | ||
window.ipcRenderer.on("update_downloaded", () => { | ||
window.ipcRenderer.removeAllListeners("update_downloaded"); | ||
message.innerText = | ||
"Update Downloaded. It will be installed on restart. Restart now?"; | ||
restartButton.classList.remove("hidden"); | ||
notification.classList.remove("hidden"); | ||
}); | ||
|
||
window.closeNotification = function closeNotification() { | ||
notification.classList.add("hidden"); | ||
}; | ||
window.restartApp = function restartApp() { | ||
window.ipcRenderer.send("restart_app"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//run once per window initialization | ||
if (window.localStorage.getItem("isDarkMode") === "true") { | ||
document.body.classList.add("bp3-dark"); | ||
} | ||
|
||
window.toggleDarkMode = () => { | ||
if (document.body.classList.contains("bp3-dark")) { | ||
window.localStorage.setItem("isDarkMode", "false"); | ||
document.body.classList.remove("bp3-dark"); | ||
} else { | ||
window.localStorage.setItem("isDarkMode", "true"); | ||
|
||
document.body.classList.add("bp3-dark"); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#notification { | ||
position: fixed; | ||
bottom: 20px; | ||
left: 20px; | ||
width: 200px; | ||
z-index: 100000; | ||
padding: 20px; | ||
border-radius: 5px; | ||
background-color: white; | ||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); | ||
} | ||
.hidden { | ||
display: none; | ||
} | ||
.darkModeBtn { | ||
z-index: 100000; | ||
position: absolute; | ||
top: 5px; | ||
right: 5px; | ||
} |