Don't show alerts in some scenarios.

This commit is contained in:
Kavin
2022-11-16 18:51:56 +00:00
parent 6b9151e47f
commit adf5f7da64
4 changed files with 7 additions and 7 deletions

View File

@@ -118,11 +118,11 @@ const mixin = {
purifyHTML(original) {
return DOMPurify.sanitize(original);
},
setPreference(key, value) {
setPreference(key, value, disableAlert = false) {
try {
localStorage.setItem(key, value);
} catch {
alert(this.$t("info.local_storage"));
if (!disableAlert) alert(this.$t("info.local_storage"));
}
},
getPreferenceBoolean(key, defaultVal) {