diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-08-23 12:40:39 -0400 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-08-23 12:40:39 -0400 |
| commit | 2bc261afbaf9377450999e49a5fe46dcbcc8b180 (patch) | |
| tree | 92d346b6bba58b7a3aef6155c9f3073028a07cf0 /src/modules/statuses.js | |
| parent | 5a1ad8409244ca7deb224b172ceb2b4acf7b8614 (diff) | |
| parent | e1ec01dc3ef90c0dc033d2e648da9a2acf8a1bdd (diff) | |
Merge branch 'feature/follow-lists' into 'develop'
Feature/follow lists
See merge request !106
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 }) |
