Skip to content

Commit 25c1d4b

Browse files
committed
notifications with no link_to are not clickable
1 parent 28a293b commit 25c1d4b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

frontend/src/components/shared/NavBarBell.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@
2727
'border-b': true,
2828
'font-bold': !notification.is_seen,}"
2929
v-for="(notification, index) in notifications" :key="index + notification.is_seen.toString()">
30+
3031
<router-link
31-
v-bind:to="getRouterLink(notification.link_to)"
32+
v-if="notification.link_to"
33+
v-bind:to="notification.link_to"
3234
class="py-4 flex items-center word-break cursor-pointer">
3335
<img v-bind:src="getImage(notification.type)" class="w-4 h-4">
3436
<h1 class="ml-4">{{notification.content}}</h1>
3537
</router-link>
38+
<div v-else class="py-4 flex items-center word-break">
39+
<img v-bind:src="getImage(notification.type)" class="w-4 h-4">
40+
<h1 class="ml-4">{{notification.content}}</h1>
41+
</div>
3642
</div>
3743
<h1 v-if="!notifications.length" class="py-4 flex items-center">No notifications</h1>
3844
</div>
@@ -75,12 +81,6 @@ export default {
7581
fetchNotificationsIntervalId: null,
7682
}),
7783
methods: {
78-
getRouterLink(link) {
79-
if (!link) {
80-
return '/';
81-
}
82-
return link;
83-
},
8484
async makeNotificationsSeen() {
8585
const length = this.notifications.length;
8686
for (let i = 0; i < length; i += 1) {

0 commit comments

Comments
 (0)