File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,18 @@ export const reducer = (state: State, action: Action): State => {
6060 return {
6161 ...state ,
6262 toasts : state . toasts . map ( ( t ) =>
63- t . id === action . toast . id
64- ? { ...t , dismissed : false , visible : true , ...action . toast }
65- : t
63+ t . id === action . toast . id ? { ...t , ...action . toast } : t
6664 ) ,
6765 } ;
6866
6967 case ActionType . UPSERT_TOAST :
7068 const { toast } = action ;
71- return state . toasts . find ( ( t ) => t . id === toast . id )
72- ? reducer ( state , { type : ActionType . UPDATE_TOAST , toast } )
73- : reducer ( state , { type : ActionType . ADD_TOAST , toast } ) ;
69+ return reducer ( state , {
70+ type : state . toasts . find ( ( t ) => t . id === toast . id )
71+ ? ActionType . UPDATE_TOAST
72+ : ActionType . ADD_TOAST ,
73+ toast,
74+ } ) ;
7475
7576 case ActionType . DISMISS_TOAST :
7677 const { toastId } = action ;
You can’t perform that action at this time.
0 commit comments