diff options
| author | tusooa <tusooa@kazv.moe> | 2022-08-30 00:14:30 +0000 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-08-30 00:14:30 +0000 |
| commit | 8b25febe36a97d113c846928dab22ab36158ee07 (patch) | |
| tree | f6f63b05e4bbc9d17258a4a559a2dc1970bbf047 /src/modules/users.js | |
| parent | 3b6c31f3b3d2326ffbe258c826f6dbd3f5374cf2 (diff) | |
| parent | dbb6f224425e059e2edc6018d0b009cc87a0aea4 (diff) | |
Merge branch 'navigation-update' into 'develop'
Navigation update + preferences storage (and some minor fixes)
See merge request pleroma/pleroma-fe!1592
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index be0bc997..de28766a 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -171,6 +171,9 @@ export const mutations = { state.relationships[relationship.id] = relationship }) }, + updateUserInLists (state, { id, inLists }) { + state.usersObject[id].inLists = inLists + }, saveBlockIds (state, blockIds) { state.currentUser.blockIds = blockIds }, @@ -298,6 +301,12 @@ const users = { .then((relationships) => store.commit('updateUserRelationship', relationships)) } }, + fetchUserInLists (store, id) { + if (store.state.currentUser) { + store.rootState.api.backendInteractor.fetchUserInLists({ id }) + .then((inLists) => store.commit('updateUserInLists', { id, inLists })) + } + }, fetchBlocks (store) { return store.rootState.api.backendInteractor.fetchBlocks() .then((blocks) => { @@ -509,6 +518,7 @@ const users = { store.dispatch('stopFetchingTimeline', 'friends') store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken())) store.dispatch('stopFetchingNotifications') + store.dispatch('stopFetchingLists') store.dispatch('stopFetchingFollowRequests') store.commit('clearNotifications') store.commit('resetStatuses') @@ -516,6 +526,7 @@ const users = { store.dispatch('setLastTimeline', 'public-timeline') store.dispatch('setLayoutWidth', windowWidth()) store.dispatch('setLayoutHeight', windowHeight()) + store.commit('clearServerSideStorage') }) }, loginUser (store, accessToken) { @@ -562,6 +573,12 @@ const users = { store.dispatch('startFetchingChats') } + store.dispatch('startFetchingLists') + + if (user.locked) { + store.dispatch('startFetchingFollowRequests') + } + if (store.getters.mergedConfig.useStreamingApi) { store.dispatch('fetchTimeline', 'friends', { since: null }) store.dispatch('fetchNotifications', { since: null }) |
