aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/DarkMode.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/DarkMode.vue')
-rw-r--r--src/components/DarkMode.vue11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue
index f0f823d..f1ed139 100644
--- a/src/components/DarkMode.vue
+++ b/src/components/DarkMode.vue
@@ -84,10 +84,13 @@ export default {
84 }, 84 },
85 85
86 watchIsDark: function () { 86 watchIsDark: function () {
87 matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => { 87 matchMedia("(prefers-color-scheme: dark)").addEventListener(
88 this.isDark = this.getIsDark(); 88 "change",
89 this.$emit("updated", this.isDark); 89 () => {
90 }); 90 this.isDark = this.getIsDark();
91 this.$emit("updated", this.isDark);
92 },
93 );
91 }, 94 },
92 }, 95 },
93}; 96};