Skip to content

Commit

Permalink
fix: move timezone cookie parsing from mounted to fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Dyskal committed Oct 16, 2024
1 parent 29615f3 commit db4dc0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/DialogSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
class="mb-2"
>
<v-list-item-content class="pt-0">
<LazyTimezoneSelector @fetch="delayedFetch" />
<lazy-timezone-selector @fetch="delayedFetch" />
</v-list-item-content>
</v-list-item>

Expand Down
4 changes: 0 additions & 4 deletions components/TimezoneSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,3 @@ export default {
}
}
</script>
<style>
</style>
28 changes: 15 additions & 13 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,19 @@ export default {
return
}
if (this.$cookies.get('timezone') !== undefined) {
try {
const tmp = this.$cookies.get('timezone', { parseJSON: true })
if (tmp && Object.keys(tmp).length > 0 && tmp.target && tmp.browser) {
this.localeUtils = tmp
} else {
this.$cookies.remove('timezone')
}
} catch (e) {
this.$cookies.remove('timezone')
}
}
try {
await this.getEvents()
} catch (e) {
Expand All @@ -453,6 +466,8 @@ export default {
}
}
this.updateTime()
this.loading = false
},
computed: {
Expand Down Expand Up @@ -512,19 +527,6 @@ export default {
}, { maxAge: 2147483646 })
}
if (this.$cookies.get('timezone') !== undefined) {
try {
const tmp = this.$cookies.get('timezone', { parseJSON: true })
if (tmp && Object.keys(tmp).length > 0 && tmp.target && tmp.browser) {
this.localeUtils = tmp
} else {
this.$cookies.remove('timezone')
}
} catch (e) {
this.$cookies.remove('timezone')
}
}
this.$nextTick(function () {
try {
const start = this.$moment(this.$refs.calendar.start).week().toString()
Expand Down

0 comments on commit db4dc0a

Please sign in to comment.