1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat: make vibrantColors a localStorage setting

This commit is contained in:
bdeshi
2022-04-24 03:39:08 +06:00
parent 5c5c462035
commit 1f19c5e93c
9 changed files with 31 additions and 8 deletions

View File

@ -2,6 +2,7 @@ PetiteVue.createApp({
//$delimiters: ['${', '}'], // https://github.com/vuejs/petite-vue/pull/100
activeTab: defaultTab,
selectedTimezone: userTimeZone,
vibrantColorEnabled: JSON.parse(localStorage.getItem('vibrant-color') || false),
get tzOptions() {
return [defaultTzOption, ...tzs.sort().map(tz => ({ value: tz, text: tz }))]
},
@ -31,8 +32,15 @@ PetiteVue.createApp({
document.querySelector('#form-delete-user').submit()
}
},
toggleVibrantColor() {
let key = 'vibrant-color';
let value = !(JSON.parse(localStorage.getItem(key) || false));
localStorage.setItem(key, value);
this.vibrantColorEnabled = value;
return value;
},
mounted() {
this.updateTab()
window.addEventListener('hashchange', () => this.updateTab())
}
}).mount('#settings-page')
}).mount('#settings-page')