fix: sửa lỗi hiển thị trên browser của điện thoại

This commit is contained in:
2026-06-20 12:19:30 +07:00
parent ae74035ad5
commit fdf41e05fc
11 changed files with 135 additions and 117 deletions
+8
View File
@@ -94,6 +94,14 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
groups[key].push(photo);
}
});
// Sort each group by likes descending
Object.values(groups).forEach((group) => {
group.sort((a, b) => {
const likesA = a.metadata?.likedUserIds?.length || 0;
const likesB = b.metadata?.likedUserIds?.length || 0;
return likesB - likesA;
});
});
return Object.values(groups);
}, [publicPhotos]);