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

chore: minor changes to vibrant colors toggling

This commit is contained in:
Ferdinand Mütsch
2022-04-24 09:26:04 +02:00
parent 9048a8eb7a
commit 30a65b4de9
4 changed files with 28 additions and 29 deletions

View File

@ -2,7 +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),
vibrantColorsEnabled: JSON.parse(localStorage.getItem('wakapi_vibrant_colors') || false),
get tzOptions() {
return [defaultTzOption, ...tzs.sort().map(tz => ({ value: tz, text: tz }))]
},
@ -32,12 +32,8 @@ 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;
onToggleVibrantColors() {
localStorage.setItem('wakapi_vibrant_colors', this.vibrantColorsEnabled)
},
mounted() {
this.updateTab()