diff options
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 0091b736..586e6ec9 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -19,7 +19,10 @@ export const defaultState = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' }, public: { statuses: [], @@ -30,7 +33,10 @@ export const defaultState = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' }, user: { statuses: [], @@ -41,7 +47,10 @@ export const defaultState = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' }, publicAndExternal: { statuses: [], @@ -52,7 +61,10 @@ export const defaultState = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' }, friends: { statuses: [], @@ -63,7 +75,10 @@ export const defaultState = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' } } } @@ -320,7 +335,10 @@ export const mutations = { newStatusCount: 0, maxId: 0, minVisibleId: 0, - loading: false + loading: false, + followers: [], + friends: [], + viewing: 'statuses' } state.timelines[timeline] = emptyTimeline @@ -347,6 +365,16 @@ export const mutations = { setError (state, { value }) { state.error = 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, notifications) { each(notifications, (notification) => { notification.seen = true @@ -363,6 +391,12 @@ const statuses = { setError ({ rootState, commit }, { value }) { commit('setError', { 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 }) |
