diff options
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 8cdd4e28..8c2d36bc 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -14,7 +14,6 @@ const emptyTl = () => ({ loading: false, followers: [], friends: [], - viewing: 'statuses', userId: 0, flushMarker: 0 }) @@ -28,8 +27,7 @@ export const defaultState = { maxId: 0, minId: Number.POSITIVE_INFINITY, data: [], - error: false, - brokenFavorites: {} + error: false }, favorites: new Set(), error: false, @@ -37,7 +35,6 @@ export const defaultState = { mentions: emptyTl(), public: emptyTl(), user: emptyTl(), - own: emptyTl(), publicAndExternal: emptyTl(), friends: emptyTl(), tag: emptyTl(), @@ -159,12 +156,6 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us const result = mergeOrAdd(allStatuses, allStatusesObject, status) status = result.item - const brokenFavorites = state.notifications.brokenFavorites[status.id] || [] - brokenFavorites.forEach((fav) => { - fav.status = status - }) - delete state.notifications.brokenFavorites[status.id] - if (result.new) { // We are mentioned in a post if (statusType(status) === 'status' && find(status.attentions, { id: user.id })) { @@ -305,7 +296,7 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot const fresh = !notification.is_seen const status = notification.ntype === 'like' - ? find(allStatuses, { id: action.in_reply_to_status_id }) + ? action.favorited_status : action const result = { @@ -315,17 +306,6 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot seen: !fresh } - if (notification.ntype === 'like' && !status) { - let broken = state.notifications.brokenFavorites[action.in_reply_to_status_id] - if (broken) { - broken.push(result) - } else { - dispatch('fetchOldPost', { postId: action.in_reply_to_status_id }) - broken = [ result ] - state.notifications.brokenFavorites[action.in_reply_to_status_id] = broken - } - } - state.notifications.data.push(result) if ('Notification' in window && window.Notification.permission === 'granted') { @@ -399,16 +379,6 @@ export const mutations = { setNotificationsSilence (state, { value }) { state.notifications.desktopNotificationSilence = value }, - setProfileView (state, { v }) { - // load followers / friends only when needed - state.timelines['user'].viewing = v - }, - addFriends (state, { friends }) { - state.timelines['user'].friends = friends - }, - addFollowers (state, { followers }) { - state.timelines['user'].followers = followers - }, markNotificationsAsSeen (state) { each(state.notifications.data, (notification) => { notification.seen = true @@ -437,12 +407,6 @@ const statuses = { setNotificationsSilence ({ rootState, commit }, { value }) { commit('setNotificationsSilence', { value }) }, - addFriends ({ rootState, commit }, { friends }) { - commit('addFriends', { friends }) - }, - addFollowers ({ rootState, commit }, { followers }) { - commit('addFollowers', { followers }) - }, deleteStatus ({ rootState, commit }, status) { commit('setDeleted', { status }) apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials }) |
