summaryrefslogtreecommitdiffstats
path: root/assets/js/settings.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--assets/js/settings.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/assets/js/settings.js b/assets/js/settings.js
index b53d2ce..7ea0b47 100644
--- a/assets/js/settings.js
+++ b/assets/js/settings.js
@@ -14,6 +14,13 @@ async function setTheme(targetTheme) {
});
}
+async function setErrorReporting(targetE) {
+ localforage.setItem("errorReporting", targetE).then((value) => {
+ console.log("ErrorReporing set: " + value);
+ UIAlert(D("errorReportingSet"), "setErrorReporting(): errorReportingSet");
+ });
+}
+
document.addEventListener("DOMContentLoaded", async () => {
$("#select-language").on("change", function() {
@@ -24,6 +31,10 @@ document.addEventListener("DOMContentLoaded", async () => {
setTheme($(this).find(":selected").val());
});
+ $("#select-errorreporting").on("change", function() {
+ setErrorReporting($(this).find(":selected").val());
+ });
+
localforage.getItem("chosenLang").then((value) => {
let selectedLanguage = value;
if(value == null || value.length < 1) {
@@ -40,6 +51,14 @@ document.addEventListener("DOMContentLoaded", async () => {
$(`#option-${selectedTheme}`).attr("selected", true);
}).catch(() => {});
+ localforage.getItem("errorReporting").then((value) => {
+ let selectedE = value;
+ if(value == null || value.length < 1) {
+ selectedE = "on";
+ }
+ $(`#option-${selectedE}`).attr("selected", true);
+ }).catch(() => {});
+
// Setup side menu
const menus = document.querySelectorAll(".side-menu");
M.Sidenav.init(menus, { edge: "right", draggable: true });