diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-04-07 22:33:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 22:33:20 +0200 |
commit | 7341d7634b5a7d66e7eab921c0fcfe7034d2047f (patch) | |
tree | 943e41fee0bc8e4333d64331fab42b967d7f9d2e /src/components/DarkMode.vue | |
parent | b2a41400540b5003431bd83f6859b74991f195c5 (diff) | |
parent | 9e1e82b0f3ce57f95f21fc09c70e2711e5105997 (diff) | |
download | homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.gz homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.zst homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.zip |
Merge branch 'main' into feature/adguard-home-customservices-doc
Diffstat (limited to 'src/components/DarkMode.vue')
-rw-r--r-- | src/components/DarkMode.vue | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue index 80491fa..677238a 100644 --- a/src/components/DarkMode.vue +++ b/src/components/DarkMode.vue | |||
@@ -15,6 +15,9 @@ | |||
15 | <script> | 15 | <script> |
16 | export default { | 16 | export default { |
17 | name: "Darkmode", | 17 | name: "Darkmode", |
18 | props: { | ||
19 | defaultValue: String, | ||
20 | }, | ||
18 | data: function () { | 21 | data: function () { |
19 | return { | 22 | return { |
20 | isDark: null, | 23 | isDark: null, |
@@ -30,6 +33,17 @@ export default { | |||
30 | if ("overrideDark" in localStorage) { | 33 | if ("overrideDark" in localStorage) { |
31 | // Light theme is 1 and Dark theme is 2 | 34 | // Light theme is 1 and Dark theme is 2 |
32 | this.mode = JSON.parse(localStorage.overrideDark) ? 2 : 1; | 35 | this.mode = JSON.parse(localStorage.overrideDark) ? 2 : 1; |
36 | } else { | ||
37 | switch (this.defaultValue) { | ||
38 | case "light": | ||
39 | this.mode = 1; | ||
40 | break; | ||
41 | case "dark": | ||
42 | this.mode = 2; | ||
43 | break; | ||
44 | default: | ||
45 | this.mode = 0; | ||
46 | } | ||
33 | } | 47 | } |
34 | this.isDark = this.getIsDark(); | 48 | this.isDark = this.getIsDark(); |
35 | this.$emit("updated", this.isDark); | 49 | this.$emit("updated", this.isDark); |