diff --git a/src/client/app/init.ts b/src/client/app/init.ts index 2f79e6cab..26f5328d7 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -82,12 +82,12 @@ Vue.mixin({ methods: { _updateDarkmode_(v) { localStorage.setItem('darkmode', v.toString()); - bus.$emit('updated', v); if (v) { document.documentElement.setAttribute('data-darkmode', 'true'); } else { document.documentElement.removeAttribute('data-darkmode'); } + bus.$emit('updated', v); }, _onDarkmodeUpdated_(v) { if (!this.$el || !this.$el.setAttribute) return;