add pin to hover view + add number of pins to dashboard + bug fixes

This commit is contained in:
daniel31x13
2024-09-11 01:38:38 -04:00
parent fb1869ca7a
commit 9b1506a64e
11 changed files with 198 additions and 123 deletions
@@ -107,9 +107,15 @@ export default async function getDashboardData(
const links = [...recentlyAddedLinks, ...pinnedLinks].sort(
(a, b) => new Date(b.id).getTime() - new Date(a.id).getTime()
);
// Make sure links are unique
const uniqueLinks = links.filter(
(link, index, self) => index === self.findIndex((t) => t.id === link.id)
);
return {
data: {
links,
links: uniqueLinks,
numberOfPinnedLinks,
},
message: "Dashboard data fetched successfully.",