aboutsummaryrefslogtreecommitdiff
path: root/src/app/js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-02-03 20:18:36 +0100
committer0neGal <mail@0negal.com>2024-02-03 20:22:16 +0100
commit6c036186d1a1295604966114f052e61ac4c01253 (patch)
treefc8b4f3ef7d713f4807158a7bd806b0ffe3a68cc /src/app/js
parent25697f42b3d1a451be16701613001b9d95efd66e (diff)
downloadViper-6c036186d1a1295604966114f052e61ac4c01253.tar.gz
Viper-6c036186d1a1295604966114f052e61ac4c01253.zip
added back error for fetching release notes
This time it's inside the GUI and not just random output.
Diffstat (limited to 'src/app/js')
-rw-r--r--src/app/js/launcher.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/app/js/launcher.js b/src/app/js/launcher.js
index 3130253..1c383b4 100644
--- a/src/app/js/launcher.js
+++ b/src/app/js/launcher.js
@@ -24,6 +24,8 @@ function page(page) {
}; page(1)
function formatRelease(notes) {
+ if (! notes) {return ""}
+
let content = "";
if (notes.length === 1) {
@@ -58,13 +60,38 @@ function formatRelease(notes) {
});
}
+// sets content of `div` to a single release block with centered text
+// inside it, the text being `lang(lang_key)`
+let set_error_content = (div, lang_key) => {
+ div.innerHTML =
+ "<div class='release-block'>" +
+ "<p><center>" +
+ lang(lang_key) +
+ "</center></p>" +
+ "</div>";
+}
+
// Updates the Viper release notes
ipcRenderer.on("vp-notes", (event, response) => {
+ if (! response) {
+ return set_error_content(
+ vpReleaseNotes,
+ "request.no_vp_release_notes"
+ )
+ }
+
vpReleaseNotes.innerHTML = formatRelease(response);
});
// Updates the Northstar release notes
ipcRenderer.on("ns-notes", (event, response) => {
+ if (! response) {
+ return set_error_content(
+ nsRelease,
+ "request.no_ns_release_notes"
+ )
+ }
+
nsRelease.innerHTML = formatRelease(response);
});