Show notification after plugin update downloaded
Summary: Add notification after plugin update downloaded Reviewed By: passy Differential Revision: D22016571 fbshipit-source-id: 188eeb848561f8461d7f76d1965dc5190d41e7d0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
74a27aafcc
commit
fb92a6f131
@@ -51,6 +51,10 @@ export type Action =
|
||||
| {
|
||||
type: 'UPDATE_CATEGORY_BLACKLIST';
|
||||
payload: Array<string>;
|
||||
}
|
||||
| {
|
||||
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<Notification>;
|
||||
client: null | string;
|
||||
|
||||
Reference in New Issue
Block a user