diff --git a/packages/app/components/notification.component.tsx b/packages/app/components/notification.component.tsx index 8fcd571a..ab7e6a0a 100644 --- a/packages/app/components/notification.component.tsx +++ b/packages/app/components/notification.component.tsx @@ -16,7 +16,9 @@ export const Notification = ({ item }: NotificationProps) => { const open = () => setIsOpen(true) const close = () => setIsOpen(false) - const displayDate = item.dateCreated + const displayDate = item.dateModified + ? moment(item.dateModified).fromNow() + : item.dateCreated ? moment(item.dateCreated).fromNow() : null diff --git a/packages/app/components/notificationsList.component.tsx b/packages/app/components/notificationsList.component.tsx index 2b09051b..177b2f51 100644 --- a/packages/app/components/notificationsList.component.tsx +++ b/packages/app/components/notificationsList.component.tsx @@ -10,6 +10,14 @@ export const NotificationsList = () => { const child = useChild() const { data } = useNotifications(child) + data.sort((a, b) => + a.dateModified > b.dateModified + ? -1 + : b.dateModified > a.dateModified + ? 1 + : 0 + ) + return (