@@ -19,7 +19,8 @@ export const modalReducer = (state: ModalState = ModalInitialState, action: Moda
1919 modalType : action . payload . modalType ,
2020 defaultValue : action . payload . defaultValue ,
2121 hideFn : action . payload . hideFn ,
22- resolve : action . payload . resolve
22+ resolve : action . payload . resolve ,
23+ next : action . payload . next
2324 }
2425
2526 const modalList : AppModal [ ] = state . modals . slice ( )
@@ -39,15 +40,22 @@ export const modalReducer = (state: ModalState = ModalInitialState, action: Moda
3940 if ( state . focusModal . resolve ) {
4041 state . focusModal . resolve ( undefined )
4142 }
43+ if ( state . focusModal . next ) {
44+ state . focusModal . next ( )
45+ }
4246 } , 250 )
4347 const modalList : AppModal [ ] = state . modals . slice ( )
4448 modalList . shift ( ) // remove the current modal from the list
49+ state . focusModal = { ...state . focusModal , hide : true , message : null }
50+ return { ...state , modals : modalList }
51+ }
52+ case modalActionTypes . processQueue : {
53+ const modalList : AppModal [ ] = state . modals . slice ( )
4554 if ( modalList . length ) {
4655 const focusModal = modalList [ 0 ] // extract the next modal from the list
4756 return { ...state , modals : modalList , focusModal }
4857 } else {
49- state . focusModal = { ...state . focusModal , hide : true , message : null }
50- return { ...state , modals : [ ] }
58+ return { ...state , modals : modalList }
5159 }
5260 }
5361 case modalActionTypes . setToast : {
0 commit comments