Skip to content

Commit 2111fd1

Browse files
committed
fix: sort order
1 parent 61995a9 commit 2111fd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/components/navbar/Notification.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const fetchEnrichedNotifications = async () => {
8686
} catch {
8787
// ignore enrichment errors
8888
}
89-
if (!enriched.message)
89+
if (!enriched.message && enriched.actor)
9090
enriched.message = makeMessage(n.kind, enriched.actor);
9191
return enriched;
9292
}),
@@ -102,7 +102,7 @@ const { data: notifications } = useQuery({
102102
const notificationItems = computed(() => {
103103
const items = (notifications.value?.data as EnrichedNotification[]) || [];
104104
// sort newest first — try common timestamp fields (date, createdAt, created_at)
105-
return items.slice().sort((a, b) => a.date?.localeCompare(b.date ?? "") || 0);
105+
return items.slice().sort((a, b) => b.date?.localeCompare(a.date ?? "") || 0);
106106
});
107107
108108
const _deleteNotificationMutation = useDeleteNotificationMutation();

0 commit comments

Comments
 (0)