diff --git a/ui/src/shared/reducers/notifications.js b/ui/src/shared/reducers/notifications.js index 0b3bde8f2c..41bce6028d 100644 --- a/ui/src/shared/reducers/notifications.js +++ b/ui/src/shared/reducers/notifications.js @@ -4,13 +4,15 @@ export const initialState = [] export const notifications = (state = initialState, action) => { switch (action.type) { case 'PUBLISH_NOTIFICATION': { - const notification = { - ...action.payload.notification, - id: uuid.v4(), - } - const newNotification = [notification] - // Hacky way to add the new notifcation to the front of the list - return [...newNotification, ...state] + const {notifcation} = action.payload + const publishedNotification = [ + { + ...notifcation, + id: uuid.v4(), + }, + ] + + return [...publishedNotification, ...state] } case 'DISMISS_NOTIFICATION': {