Skip to content

Commit aa0163f

Browse files
committed
fix(VoNotificationsBanner): fetch banners on mount
Banners were only fetched when VoNotificationsNavItem mounted, which required the user menu to render. Now the banner component fetches its own data, ensuring banners display for all users.
1 parent 1f92f86 commit aa0163f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/notifications/VoNotificationsBanner.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
const user = useUserStore()
9292
const banners = useBannersStore()
9393
94+
onMounted(() => {
95+
banners.index()
96+
})
97+
9498
const banner = computed(() => banners.banner)
9599
const height = computed(() => banner.value?.metadata.height || (banner.value?.metadata.subtext ? 88 : 48))
96100
const hasPromotion = computed(() => {

src/components/notifications/VoNotificationsNavItem.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121
// Icons
2222
import { mdiBellOutline } from '@mdi/js'
2323
24-
const banners = useBannersStore()
2524
const user = useUserStore()
2625
const notifications = useNotificationsStore()
2726
const dialog = shallowRef(false)
2827
29-
onMounted(async () => {
28+
onMounted(() => {
3029
notifications.index()
31-
banners.index()
3230
})
3331
</script>

0 commit comments

Comments
 (0)