Skip to content

Commit

Permalink
fix(TopBar): do not fetch events if actor is a guest or it is not ini…
Browse files Browse the repository at this point in the history
…tialized yet

Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Sep 15, 2024
1 parent 8dcfb13 commit 9641fff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ import BreakoutRoomsEditor from '../BreakoutRoomsEditor/BreakoutRoomsEditor.vue'
import ConversationIcon from '../ConversationIcon.vue'
import { useGetParticipants } from '../../composables/useGetParticipants.js'
import { AVATAR, CONVERSATION } from '../../constants.js'
import { AVATAR, CONVERSATION, ATTENDEE } from '../../constants.js'
import BrowserStorage from '../../services/BrowserStorage.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { useChatExtrasStore } from '../../stores/chatExtras.js'
Expand Down Expand Up @@ -304,13 +304,19 @@ export default {
return this.nextEvent && !this.isInCall && !this.isSidebar && !this.isMobile
&& this.conversation.type !== CONVERSATION.TYPE.NOTE_TO_SELF
},
isGuestActor() {
return this.$store.getters.getActorType() === ATTENDEE.ACTOR_TYPE.GUESTS
|| this.$store.getters.getActorType() === null // not initialized yet
},
},
watch: {
token: {
immediate: true,
handler(value) {
if (!value || this.isSidebar) {
if (!value || this.isSidebar || this.isGuestActor) {
// Do not fetch upcoming events for guests (401 unauthorzied) or in sidebar
return
}
this.chatExtrasStore.getUpcomingEvents(value)
Expand Down

0 comments on commit 9641fff

Please sign in to comment.