aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/statuses.js17
-rw-r--r--src/modules/users.js17
2 files changed, 17 insertions, 17 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 8cdd4e28..5bbf5f46 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
})
@@ -399,16 +398,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 +426,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 })
diff --git a/src/modules/users.js b/src/modules/users.js
index 65b172bc..31fe94fc 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -51,6 +51,15 @@ export const mutations = {
endLogin (state) {
state.loggingIn = false
},
+ // TODO Clean after ourselves?
+ addFriends (state, { id, friends }) {
+ const user = state.usersObject[id]
+ user.friends = friends
+ },
+ addFollowers (state, { id, followers }) {
+ const user = state.usersObject[id]
+ user.followers = followers
+ },
addNewUsers (state, users) {
each(users, (user) => mergeOrAdd(state.users, state.usersObject, user))
},
@@ -92,6 +101,14 @@ const users = {
store.rootState.api.backendInteractor.fetchUser({ id })
.then((user) => store.commit('addNewUsers', [user]))
},
+ addFriends ({ rootState, commit }, { id }) {
+ rootState.api.backendInteractor.fetchFriends({ id })
+ .then((friends) => commit('addFriends', { id, friends }))
+ },
+ addFollowers ({ rootState, commit }, { id }) {
+ rootState.api.backendInteractor.fetchFollowers({ id })
+ .then((followers) => commit('addFollowers', { id, followers }))
+ },
registerPushNotifications (store) {
const token = store.state.currentUser.credentials
const vapidPublicKey = store.rootState.instance.vapidPublicKey