diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-02-18 20:56:03 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-02-18 20:56:03 +0100 |
| commit | 209e8614b09ab7f24262d86de0924bd2e0dd96ec (patch) | |
| tree | c054161a035d97ec3102f852f0deca4af9a5ea09 /src/modules/statuses.js | |
| parent | 963a0035e5e3f35ee790aeb3db64cb8dd32a84a4 (diff) | |
Don't add notifications twice + persiste them.
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 0967f77a..491d0024 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -173,7 +173,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us } const addNotification = ({type, status, action}) => { - state.notifications.push({type, status, action, seen: false}) + // Only add a new notification if we don't have one for the same action + if (!find(state.notifications, (oldNotification) => oldNotification.action.id === action.id)) { + state.notifications.push({type, status, action, seen: false}) + } } const favoriteStatus = (favorite) => { |
