Skip to content

Commit

Permalink
fix(protocol-designer): refine logic for persisted state
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Dec 18, 2024
1 parent f38bb0b commit c1fb0fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion protocol-designer/src/analytics/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ const hasOptedIn: Reducer<OptInState, any> = handleActions(
action: RehydratePersistedAction
) => {
const persistedState = action.payload?.['analytics.hasOptedIn']
return persistedState !== undefined ? persistedState : optInInitialState
if (persistedState == null || persistedState?.hasOptedIn == null) {
return optInInitialState
} else {
return persistedState
}
},
},
optInInitialState
Expand Down

0 comments on commit c1fb0fb

Please sign in to comment.