fix unread notification tab and empty state
This commit is contained in:
parent
f0dec81150
commit
0f65b0ea7c
1 changed files with 12 additions and 2 deletions
|
|
@ -31,7 +31,10 @@
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<p>Vous n’avez pas de nouvelles notifications</p>
|
<p v-if="currentTab === 'all'">
|
||||||
|
Vous n’avez pas de nouvelles notifications
|
||||||
|
</p>
|
||||||
|
<p v-else>Vous n’avez pas de notifications non lues</p>
|
||||||
</div>
|
</div>
|
||||||
<section v-else class="notifications | flow">
|
<section v-else class="notifications | flow">
|
||||||
<template
|
<template
|
||||||
|
|
@ -91,9 +94,16 @@ const notificationComponents = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const sortedNotifications = computed(() => {
|
const sortedNotifications = computed(() => {
|
||||||
return [...notifications.value].sort((a, b) => {
|
const sortedNotifications = [...notifications.value].sort((a, b) => {
|
||||||
return dayjs(b.date).diff(dayjs(a.date));
|
return dayjs(b.date).diff(dayjs(a.date));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (currentTab.value === "unread") {
|
||||||
|
return sortedNotifications.filter(
|
||||||
|
(notification) => notification.isread !== "true"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return sortedNotifications;
|
||||||
});
|
});
|
||||||
|
|
||||||
function changeTab(newValue) {
|
function changeTab(newValue) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue