From fb92a6f131757cbef656ddd27c6af01bd43bed2b Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Fri, 12 Jun 2020 06:09:46 -0700 Subject: [PATCH] Show notification after plugin update downloaded Summary: Add notification after plugin update downloaded Reviewed By: passy Differential Revision: D22016571 fbshipit-source-id: 188eeb848561f8461d7f76d1965dc5190d41e7d0 --- desktop/app/src/reducers/notifications.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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;