diff options
| author | taehoon <th.dev91@gmail.com> | 2019-02-25 04:51:23 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-02-28 12:41:20 -0500 |
| commit | 080786c9458ba8b9db1ea63732824a3e297e10dc (patch) | |
| tree | 0f25295769d0b1da4bafa70f3b56e571999a5c60 /src/modules/users.js | |
| parent | cb383df517dc5cd5b4d90136b533977a33611b71 (diff) | |
Rewrite FollowList using hocs
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index b2821a92..093af497 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -72,14 +72,20 @@ export const mutations = { }, // Because frontend doesn't have a reason to keep these stuff in memory // outside of viewing someones user profile. - clearFriendsAndFollowers (state, userKey) { - const user = state.usersObject[userKey] + clearFriends (state, userId) { + const user = state.usersObject[userId] if (!user) { return } user.friends = [] - user.followers = [] user.friendsPage = 0 + }, + clearFollowers (state, userId) { + const user = state.usersObject[userId] + if (!user) { + return + } + user.followers = [] user.followersPage = 0 }, addNewUsers (state, users) { @@ -197,8 +203,11 @@ const users = { return followers }) }, - clearFriendsAndFollowers ({ commit }, userKey) { - commit('clearFriendsAndFollowers', userKey) + clearFriends ({ commit }, userId) { + commit('clearFriends', userId) + }, + clearFollowers ({ commit }, userId) { + commit('clearFollowers', userId) }, registerPushNotifications (store) { const token = store.state.currentUser.credentials |
