diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-03-18 12:51:46 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-03-18 12:51:46 +0300 |
commit | b809eb15f0f81a05d686b4bd2edfa715819f614b (patch) | |
tree | 62bd99c954ef4375b9c77c9df73de4d3d218033a /src/PublicShareAuthSidebar.vue | |
parent | 7b6d1065d0f2c6d6b8bb46acfe5100856a2e0cfd (diff) |
Refactor usages of fetchConversation
Instead of calling the service's "fetchConversation" method and manually
adding to the store, use the new "fetchConversation" store action that
does that directly
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src/PublicShareAuthSidebar.vue')
-rw-r--r-- | src/PublicShareAuthSidebar.vue | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/PublicShareAuthSidebar.vue b/src/PublicShareAuthSidebar.vue index e30f9b70d..11dbfac2f 100644 --- a/src/PublicShareAuthSidebar.vue +++ b/src/PublicShareAuthSidebar.vue @@ -42,7 +42,6 @@ import CallView from './components/CallView/CallView' import ChatView from './components/ChatView' import { PARTICIPANT } from './constants' import { EventBus } from './services/EventBus' -import { fetchConversation } from './services/conversationsService' import { joinConversation, leaveConversationSync, @@ -165,15 +164,17 @@ export default { } try { - const response = await fetchConversation(this.token) - this.$store.dispatch('addConversation', response.data.ocs.data) + await this.$store.dispatch('fetchConversation', { token: this.token }) // Although the current participant is automatically added to // the participants store it must be explicitly set in the // actors store. if (!this.$store.getters.getUserId()) { + // Set the current actor/participant for guests + const conversation = this.$store.getters.conversation(this.token) + // Setting a guest only uses "sessionId" and "participantType". - this.$store.dispatch('setCurrentParticipant', response.data.ocs.data) + this.$store.dispatch('setCurrentParticipant', conversation) } } catch (exception) { window.clearInterval(this.fetchCurrentConversationIntervalId) |