From 2f4203fdcdbbe606fa0807fc5492c93c0604100c Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Sun, 15 Sep 2024 15:53:31 +0200 Subject: [PATCH] fix(TopBar): do not fetch events if actor is a guest or it is not initialized yet Signed-off-by: DorraJaouad --- src/components/TopBar/TopBar.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index fac453712c5..e2c6276de96 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -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)