diff --git a/desktop/app/src/reducers/notifications.tsx b/desktop/app/src/reducers/notifications.tsx index aae970e0f..9ee70bcf8 100644 --- a/desktop/app/src/reducers/notifications.tsx +++ b/desktop/app/src/reducers/notifications.tsx @@ -51,6 +51,10 @@ export type Action = | { type: 'UPDATE_CATEGORY_BLACKLIST'; payload: Array; + } + | { + type: 'ADD_NOTIFICATION'; + payload: PluginNotification; }; const INITIAL_STATE: State = { @@ -94,6 +98,11 @@ export default function reducer( ...state, blacklistedCategories: action.payload, }; + case 'ADD_NOTIFICATION': + return { + ...state, + activeNotifications: [...state.activeNotifications, action.payload], + }; default: return state; } @@ -140,6 +149,13 @@ function activeNotificationsReducer( }; } +export function addNotification(payload: PluginNotification): Action { + return { + type: 'ADD_NOTIFICATION', + payload, + }; +} + export function setActiveNotifications(payload: { notifications: Array; client: null | string;