Skip to content

Commit

Permalink
fix sort order of notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanM322 committed Jul 5, 2024
1 parent 5e183e1 commit 190dcd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ const MobileNavigationList: React.FC<IMobileNavigationList> = ({
{flagLoading ? (
<LoadingComponent />
) : notificationArray && notificationArray.length > 0 ? (
notificationArray.map((el) => {
notificationArray.sort((a,b) => {
if (a.read === b.read) {
return 0;
}
return a.read ? 1 : -1;
}).map((el) => {
return (
<NotificationBox
getNotifications={getNotifications}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ const PopUpNotification = ({getNotifications, realDataNotification, notification
overflowY: 'auto'
}}>
{realDataNotification && realDataNotification.length > 0 ? (
realDataNotification.map((el) => {
realDataNotification.sort((a, b) => {
if (a.read === b.read) {
return 0;
}
return a.read ? 1 : -1;
}).map((el) => {
return (
<NotificationBox
currentUserAddress={currentUserAddress}
Expand Down

0 comments on commit 190dcd5

Please sign in to comment.