@@ -150,7 +150,11 @@ export const ShieldSubscriptionProvider: React.FC = ({ children }) => {
150150 }
151151
152152 if ( isShieldSubscriptionActive ) {
153- dispatch ( setShowShieldEntryModalOnce ( false ) ) ;
153+ dispatch (
154+ setShowShieldEntryModalOnce ( {
155+ show : false ,
156+ } ) ,
157+ ) ;
154158 return ;
155159 }
156160
@@ -213,14 +217,16 @@ export const ShieldSubscriptionProvider: React.FC = ({ children }) => {
213217 return ;
214218 }
215219
216- const shouldSubmitUserEvents = true ; // submits `shield_entry_modal_viewed` event
217220 dispatch (
218- setShowShieldEntryModalOnce (
219- true ,
220- shouldSubmitUserEvents ,
221- entrypointCohort ,
221+ setShowShieldEntryModalOnce ( {
222+ show : true ,
223+ shouldSubmitEvents : true , // submits `shield_entry_modal_viewed` event
224+ triggeringCohort : entrypointCohort ,
222225 modalType,
223- ) ,
226+ // we will show the modal but we won't update the background state yet,
227+ // we will only update after the user has interacted with the modal
228+ shouldUpdateBackgroundState : false ,
229+ } ) ,
224230 ) ;
225231 return ;
226232 }
@@ -236,14 +242,16 @@ export const ShieldSubscriptionProvider: React.FC = ({ children }) => {
236242 modalType ,
237243 ) ;
238244 if ( selectedCohort ?. cohort === COHORT_NAMES . WALLET_HOME ) {
239- const shouldSubmitUserEvents = true ; // submits `shield_entry_modal_viewed` event to subscription backend
240245 dispatch (
241- setShowShieldEntryModalOnce (
242- true ,
243- shouldSubmitUserEvents ,
244- selectedCohort . cohort ,
246+ setShowShieldEntryModalOnce ( {
247+ show : true ,
248+ shouldSubmitEvents : true , // submits `shield_entry_modal_viewed` event to subscription backend
249+ triggeringCohort : selectedCohort . cohort ,
245250 modalType,
246- ) ,
251+ // we will show the modal but we won't update the background state yet,
252+ // we will only update after the user has interacted with the modal
253+ shouldUpdateBackgroundState : false ,
254+ } ) ,
247255 ) ;
248256 }
249257 }
0 commit comments