diff --git a/components/Event.vue b/components/Event.vue index 72b7f211..0f253f72 100644 --- a/components/Event.vue +++ b/components/Event.vue @@ -24,10 +24,7 @@ import { mdiRepeat, mdiCalendar, mdiMapMarker } from '@mdi/js' export default { data({ $store }) { return { mdiRepeat, mdiMapMarker, mdiCalendar, - // user can't see hidden thumbs hide_thumbs: this.$cookies.get('theme.hide_thumbs') || $store.state.settings.hide_thumbs - // user can override - // hide_thumbs: this.$cookies.get('theme.hide_thumbs') } }, components: { diff --git a/components/ThemeView.vue b/components/ThemeView.vue index af66fe92..b75da049 100644 --- a/components/ThemeView.vue +++ b/components/ThemeView.vue @@ -1,7 +1,7 @@ @@ -14,6 +14,8 @@ export default { data ({ $store }) { return { mdiViewModule, mdiViewList, mdiContrastCircle, + hide_thumbs: $store.state.settings.hide_thumbs, + hide_thumbs_icon: $store.state.settings.hide_thumbs, reload: 0 } }, @@ -27,28 +29,20 @@ export default { }) }, async _hide_thumbs() { - const theme_hide_thumbs = await this.$cookies.get('theme.hide_thumbs') + let theme_hide_thumbs = await this.$cookies.get('theme.hide_thumbs') if (theme_hide_thumbs != null) { - this.hide_thumbs = !theme_hide_thumbs + theme_hide_thumbs = !theme_hide_thumbs } else { - this.hide_thumbs = !$store.state.settings.hide_thumbs + theme_hide_thumbs = !this.settings.hide_thumbs } - await this.$cookies.set('theme.hide_thumbs', this.hide_thumbs, { + await this.$cookies.set('theme.hide_thumbs', theme_hide_thumbs, { path: '/', maxAge: 60 * 60 * 24 * 7 }) - await this.reload++ + this.hide_thumbs_icon = theme_hide_thumbs + this.reload++ this.$root.$emit('layout_loaded', true) }, - async hide_thumbs () { - const hide_thumbs = await this.$cookies.get('theme.hide_thumbs') - if (hide_thumbs != null) { - this.hide_thumbs = hide_thumbs - } else { - this.hide_thumbs = $store.state.settings.hide_thumbs - } - return hide_thumbs - } } }