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 <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad authored and backportbot[bot] committed Oct 14, 2024
1 parent 1a3ccbe commit da077dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,18 @@ export default {
return this.nextEvent && !this.isInCall && !this.isSidebar && !this.isMobile
&& this.conversation.type !== CONVERSATION.TYPE.NOTE_TO_SELF
},
getUserId() {
return this.$store.getters.getUserId()
},
},
watch: {
token: {
immediate: true,
handler(value) {
if (!value || this.isSidebar) {
if (!value || this.isSidebar || !this.getUserId) {
// Do not fetch upcoming events for guests (401 unauthorzied) or in sidebar
return
}
this.chatExtrasStore.getUpcomingEvents(value)
Expand Down

0 comments on commit da077dc

Please sign in to comment.