Fixed hydration errors
Moved some code to client only (it makes sense given the localstorage stuff)
This commit is contained in:
@@ -7,8 +7,8 @@ import {
|
||||
type LeimPeriod,
|
||||
type LeimPeriodShort
|
||||
} from '@/models/Date'
|
||||
import { useSessionStorage, useUrlSearchParams } from '@vueuse/core'
|
||||
import { defineStore } from 'pinia'
|
||||
import { useLocalStorage, useUrlSearchParams } from '@vueuse/core'
|
||||
import { defineStore, skipHydrate } from 'pinia'
|
||||
import { computed, ref, type ComputedRef, type Ref } from 'vue'
|
||||
|
||||
type CalendarViewType = 'month' | 'year' | 'decade' | 'century'
|
||||
@@ -161,7 +161,7 @@ export const useCalendar = defineStore('calendar', () => {
|
||||
}
|
||||
})
|
||||
|
||||
const selectedDate = useSessionStorage<LeimDate>('selected-date', currentLeimDate.value, { deep: true })
|
||||
const selectedDate = useLocalStorage<LeimDate>('selected-date', currentLeimDate.value, { deep: true })
|
||||
|
||||
/**
|
||||
* Check whether the current viewType is active
|
||||
@@ -393,7 +393,7 @@ export const useCalendar = defineStore('calendar', () => {
|
||||
currentDate,
|
||||
currentLeimDate,
|
||||
defaultDate,
|
||||
selectedDate,
|
||||
selectedDate: skipHydrate(selectedDate),
|
||||
selectDate,
|
||||
params,
|
||||
getPeriodOfYear,
|
||||
|
||||
@@ -38,7 +38,6 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||
eventsAreLoading.value = false
|
||||
}
|
||||
}
|
||||
fetchEvents()
|
||||
|
||||
/**
|
||||
* Determines if the event can appear in the front end
|
||||
|
||||
Reference in New Issue
Block a user