Fixing alerts to not show already handled alerts.
This commit is contained in:
@@ -190,11 +190,12 @@ export default function(state = initialState, action) {
|
|||||||
case MARK_ACTION_CHANGE_HANDLED:
|
case MARK_ACTION_CHANGE_HANDLED:
|
||||||
return { ...state, ui: { ...state.ui, actionChangeHandled: true }};
|
return { ...state, ui: { ...state.ui, actionChangeHandled: true }};
|
||||||
case ALERT:
|
case ALERT:
|
||||||
|
let existingAlert = state.ui.alerts[action.id];
|
||||||
let alerts = { ...state.ui.alerts,
|
let alerts = { ...state.ui.alerts,
|
||||||
[action.id]: { type: action.value,
|
[action.id]: { type: action.value,
|
||||||
id: action.id,
|
id: action.id,
|
||||||
contents: action.contents,
|
contents: action.contents,
|
||||||
handled: false }
|
handled: existingAlert ? existingAlert.handled : false }
|
||||||
};
|
};
|
||||||
return { ...state, ui: { ...state.ui,
|
return { ...state, ui: { ...state.ui,
|
||||||
alerts,
|
alerts,
|
||||||
|
|||||||
Reference in New Issue
Block a user