@@ -5,6 +5,7 @@ import type { AppStoreGetters, AppStoreState } from '@/store/modules/app/types/a
55import nextState from '@/store/modules/app/actions/nextState'
66import setHasPendingUrlParsing from '@/store/modules/app/actions/setHasPendingUrlParsing'
77import setInitialUrlParsingHasHappened from '@/store/modules/app/actions/setInitialUrlParsingHasHappened'
8+ import setLegacyUrlParamsParsedHasHappened from '@/store/modules/app/actions/setLegacyUrlParamsParsingHasHappened'
89import isConfigLoaded from '@/store/modules/app/getters/isConfigLoaded'
910import isCurrentStateFulfilled from '@/store/modules/app/getters/isCurrentStateFulfilled'
1011import isLoadingConfig from '@/store/modules/app/getters/isLoadingConfig'
@@ -51,7 +52,10 @@ const initiateUrlParsing: AppState = {
5152
5253const parseLegacyUrlParams : AppState = {
5354 name : AppStateNames . LegacyParsing ,
54- isFulfilled : ( ) => ! isLegacyParams ( window ?. location ?. search ) ,
55+ // legacParamsParsingHasHappened is necessary to reevaluate after the legacy parsing has happened, without it,
56+ // isFulfilled would always return false/true after the first time
57+ // it also has to be the first condition because the && operator is short-circuiting
58+ isFulfilled : ( ) => useAppStore ( ) . legacParamsParsingHasHappened && ! isLegacyParams ( window ?. location ?. search ) ,
5559 next : ( ) => {
5660 return initiateUrlParsing
5761 } ,
@@ -89,6 +93,7 @@ const state = (): AppStoreState => ({
8993 appState : initializing ,
9094 initialUrlParsingHasHappened : false ,
9195 hasPendingUrlParsing : false ,
96+ legacParamsParsingHasHappened : false ,
9297} )
9398
9499const getters : AppStoreGetters = {
@@ -105,6 +110,7 @@ const actions = {
105110 nextState,
106111 setHasPendingUrlParsing,
107112 setInitialUrlParsingHasHappened,
113+ setLegacyUrlParamsParsedHasHappened,
108114}
109115
110116const useAppStore = defineStore ( 'app' , {
0 commit comments