Updated Toast alerts, progress mvp
• Updated: - Toast alerts
This commit is contained in:
@@ -10,13 +10,13 @@ const initialState = ImmutableList([])
|
||||
export default function toasts(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case TOAST_SHOW:
|
||||
return state.push(ImmutableMap({
|
||||
return state.set(state.size, ImmutableMap({
|
||||
key: state.size > 0 ? state.last().get('key') + 1 : 0,
|
||||
message: action.message,
|
||||
message: 'action.message',
|
||||
type: action.toastType,
|
||||
}))
|
||||
case TOAST_DISMISS:
|
||||
return state.filterNot(item => item.get('key') === action.toast.key)
|
||||
return state.filterNot(item => item.get('key') === action.toastKey)
|
||||
case TOAST_CLEAR:
|
||||
return state.clear()
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user