@@ -63,7 +63,10 @@ const setActivityYear = async (event: string) => {
pageStore.loading = true
await em.patch(Access, accessProfileStore.currentAccessId, { activityYear: activityYear })
- await em.refreshProfile()
+ if (process.server) {
+ // Force profile refresh server side to avoid a bug where server and client stores diverge on profile refresh
+ await em.refreshProfile()
+ }
window.location.reload()
}
@@ -68,11 +68,11 @@ const onUpdate = async (newValue: Array<string>) => {
setDirty(false)
- await em.patch(
- Access,
- accessProfileStore.id,
- {'historical': accessProfileStore.historical}
- )
+ await em.patch(Access, accessProfileStore.id, {'historical': accessProfileStore.historical})
@@ -51,11 +51,11 @@ const updateDateTimeRange = async (dates: Array<Date>): Promise<any> => {