aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/SettingToggle.vue
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-04-07 22:33:20 +0200
committerGitHub <noreply@github.com>2022-04-07 22:33:20 +0200
commit7341d7634b5a7d66e7eab921c0fcfe7034d2047f (patch)
tree943e41fee0bc8e4333d64331fab42b967d7f9d2e /src/components/SettingToggle.vue
parentb2a41400540b5003431bd83f6859b74991f195c5 (diff)
parent9e1e82b0f3ce57f95f21fc09c70e2711e5105997 (diff)
downloadhomer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.gz
homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.zst
homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.zip
Merge branch 'main' into feature/adguard-home-customservices-doc
Diffstat (limited to 'src/components/SettingToggle.vue')
-rw-r--r--src/components/SettingToggle.vue3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/SettingToggle.vue b/src/components/SettingToggle.vue
index 985ca84..6c8a10f 100644
--- a/src/components/SettingToggle.vue
+++ b/src/components/SettingToggle.vue
@@ -12,6 +12,7 @@ export default {
12 name: String, 12 name: String,
13 icon: String, 13 icon: String,
14 iconAlt: String, 14 iconAlt: String,
15 defaultValue: Boolean,
15 }, 16 },
16 data: function () { 17 data: function () {
17 return { 18 return {
@@ -24,6 +25,8 @@ export default {
24 25
25 if (this.name in localStorage) { 26 if (this.name in localStorage) {
26 this.value = JSON.parse(localStorage[this.name]); 27 this.value = JSON.parse(localStorage[this.name]);
28 } else {
29 this.value = this.defaultValue;
27 } 30 }
28 31
29 this.$emit("updated", this.value); 32 this.$emit("updated", this.value);