diff options
| author | shpuld <shpuld@gmail.com> | 2017-02-18 22:37:48 +0200 |
|---|---|---|
| committer | shpuld <shpuld@gmail.com> | 2017-02-18 22:37:48 +0200 |
| commit | e6f91badfbab71ed8c924bd49a86715852886ff1 (patch) | |
| tree | 176ac77d5dfb9c3cd08cb3c56412d5d1e9a18835 /src/modules/statuses.js | |
| parent | be2b90df1d3b3369d451476293749bf5d6b1457d (diff) | |
| parent | f7a38eb02175e92b2c2029c88e87d877157ffcab (diff) | |
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma-fe into develop
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 + }) } } |
