aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com> 2021-05-23 23:21:05 +0200
committerMango0x45 <thomasvoss@live.com> 2021-05-23 23:21:05 +0200
commit81b026fe0498df5c8008a4f89d55d414f6866a35 (patch)
treeba066673621ab0eae6bf7c6a67d5488953ea795b
parent802625dbdc56d472e5e6bc613a33992c9a6e4cc6 (diff)
Fix mod message resetting every time
-rw-r--r--settings.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/settings.js b/settings.js
index db0cd4c..29b85d4 100644
--- a/settings.js
+++ b/settings.js
@@ -87,9 +87,18 @@ function set_mod_message(event)
if (event && event.target.value.replace(/\s/g, ""))
localStorage.setItem("custom_mod_message", event.target.value);
else {
- if (event)
- event.target.value = mod_message_default;
- localStorage.setItem("custom_mod_message", mod_message_default);
+ let mm;
+ if (event) {
+ mm = mod_message_default;
+ event.target.value = mm;
+ }
+ else {
+ mm = localStorage.getItem("custom_mod_message");
+ if (!mm)
+ mm = mod_message_default;
+ }
+
+ localStorage.setItem("custom_mod_message", mm);
}
}