aboutsummaryrefslogtreecommitdiff
path: root/src/modules/users.js
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-09-07 09:47:17 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-09-07 09:47:17 +0300
commitfa2b680855c790ba8ed8d7cc0dbf2a3a2e1dbaf6 (patch)
treeb2868a1c0d2fce025134af4167c824fc8ee49068 /src/modules/users.js
parent12519a54b55140a3e5f76e67ac53914654c2a8b0 (diff)
parenta73b09c73202117ffa3fecf7a9185981d6696912 (diff)
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into develop
Diffstat (limited to 'src/modules/users.js')
-rw-r--r--src/modules/users.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js
index 68d02931..9245db5c 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -266,6 +266,11 @@ const users = {
mutations,
getters,
actions: {
+ fetchUserIfMissing (store, id) {
+ if (!store.getters.findUser(id)) {
+ store.dispatch('fetchUser', id)
+ }
+ },
fetchUser (store, id) {
return store.rootState.api.backendInteractor.fetchUser({ id })
.then((user) => {
@@ -493,6 +498,8 @@ const users = {
store.dispatch('stopFetchingFollowRequests')
store.commit('clearNotifications')
store.commit('resetStatuses')
+ store.dispatch('resetChats')
+ store.dispatch('setLastTimeline', 'public-timeline')
})
},
loginUser (store, accessToken) {
@@ -532,6 +539,9 @@ const users = {
// Start fetching notifications
store.dispatch('startFetchingNotifications')
+
+ // Start fetching chats
+ store.dispatch('startFetchingChats')
}
if (store.getters.mergedConfig.useStreamingApi) {
@@ -539,6 +549,7 @@ const users = {
console.error('Failed initializing MastoAPI Streaming socket', error)
startPolling()
}).then(() => {
+ store.dispatch('fetchChats', { latest: true })
setTimeout(() => store.dispatch('setNotificationsSilence', false), 10000)
})
} else {