Skip to content

Commit 28a293b

Browse files
committed
show notifications bell only when fetching is done
1 parent 095e009 commit 28a293b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/components/shared/NavBarBell.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<!-- eslint-disable max-len -->
3-
<div class="ml-auto mr-8 relative pr-1 z-50 outline-none" @focusout="close" tabindex="1">
3+
<div v-if="notificationsFetched" class="ml-auto mr-8 relative pr-1 z-50 outline-none" @focusout="close" tabindex="1">
44
<div class="outline-none">
55
<img v-on:click="toggle()" src="../../assets/bell.png" class="w-5 cursor-pointer">
66
<div v-on:click="toggle()" v-if="notify" class="w-3 h-3 bg-purple-matcha cursor-pointer rounded-full absolute right-0 bottom-0 ml-2 pl-1"></div>
@@ -70,6 +70,7 @@ export default {
7070
// { content: 'Bae liked youBae liked youBae liked youBae liked youBae liked youBae liked you', id: 10, is_seen: true, type: 'like', link_to: 'google.com' },
7171
// ],
7272
notifications: [],
73+
notificationsFetched: false,
7374
showNotifications: false,
7475
fetchNotificationsIntervalId: null,
7576
}),
@@ -150,6 +151,7 @@ export default {
150151
await this.fetchNotifications();
151152
await this.newNotificationCheck();
152153
this.fetchNotificationsIntervalId = setInterval(this.fetchNewNotifications, 5000);
154+
this.notificationsFetched = true;
153155
},
154156
beforeDestroy() {
155157
window.clearInterval(this.fetchNotificationsIntervalId);

0 commit comments

Comments
 (0)