File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ export function useUrlPageTheme(): PageContextState {
163
163
dispatch ( pageContextSlice . actions . updatePageContext ( {
164
164
subject : urlContext ?. subject ,
165
165
stage : urlContext ?. stage ,
166
+ previousContext : { subject : urlContext ?. subject , stage : urlContext ?. stage } ,
166
167
} ) ) ;
167
168
168
169
return ( ) => {
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ export const pageContextSlice = createSlice({
12
12
reducers : {
13
13
updatePageContext : ( state , action : actionType ) => ( {
14
14
...state ,
15
- stage : action . payload ?. stage ?? state ?. stage ,
16
- subject : action . payload ?. subject ?? state ?. subject ,
15
+ // stage and subject can be undefined, so should not ??-inherit from the previous context
16
+ stage : action . payload ?. stage ,
17
+ subject : action . payload ?. subject ,
17
18
previousContext : action . payload ?. previousContext ?? state ?. previousContext ,
18
19
} ) ,
19
20
resetPageContext : ( state ) => ( {
You can’t perform that action at this time.
0 commit comments