瀏覽代碼

fix(nightmode): toggling for the first time logged-out wasn't working

Signed-off-by: Jonathan Graham <theflametrooper@gmail.com>
Jonathan Graham 3 年之前
父節點
當前提交
987cdbf489
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      frontend/src/components/layout/MainHeader.vue

+ 2 - 0
frontend/src/components/layout/MainHeader.vue

@@ -106,6 +106,7 @@ export default {
 	},
 	watch: {
 		localNightmode(newValue, oldValue) {
+			console.log(newValue, oldValue, this.localNightmode);
 			if (oldValue === null) return;
 
 			localStorage.setItem("nightmode", this.localNightmode);
@@ -125,6 +126,7 @@ export default {
 	},
 	async mounted() {
 		this.localNightmode = JSON.parse(localStorage.getItem("nightmode"));
+		if (this.localNightmode === null) this.localNightmode = false;
 
 		this.socket.dispatch("users.getPreferences", res => {
 			if (res.status === "success")