diff options
| author | Roger Braun <roger@rogerbraun.net> | 2017-02-20 18:58:18 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2017-02-20 18:58:18 +0100 |
| commit | 5d8b2eb8b57efa36f9bde45fbbffc2e19f675eb4 (patch) | |
| tree | f7883fdbe27a2cfd81ff72437450976cc243d2f2 /src/modules/statuses.js | |
| parent | 9d0d1f7de1e37cb40d7ecd34fd93744f55142e2b (diff) | |
| parent | 73afa8e075cd8e97b09526e2393b0aafc9c8e4e5 (diff) | |
Merge branch 'develop' into feature/hash-routed
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 871172b5..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}) + // 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) => { @@ -276,6 +279,11 @@ export const mutations = { setNsfw (state, { id, nsfw }) { const newStatus = find(state.allStatuses, { id }) newStatus.nsfw = nsfw + }, + markNotificationsAsSeen (state, notifications) { + each(notifications, (notification) => { + notification.seen = true + }) } } |
