Skip to content

Commit

Permalink
Merge pull request #31 from appwrite/fix-upvotes
Browse files Browse the repository at this point in the history
Fix upvotes
  • Loading branch information
loks0n authored Jun 16, 2023
2 parents 7fb0d84 + 31d3be7 commit 5470234
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ export default component$(() => {
const homeDataSignal = useHomeData();
const homeData = homeDataSignal.value;

const allProjects = [
...(homeData.featured ? [homeData.featured] : []),
...(homeData.newAndShiny ?? []),
...(homeData.trendZone ?? []),
...(homeData.madeWithTailwind ?? []),
];

const projectIds = useComputed$(() =>
allProjects.map((project) => project.$id)
);
useUpvotes(projectIds);

useVisibleTask$(async () => {
account.value = await AppwriteService.getAccount();
});
Expand Down Expand Up @@ -142,6 +130,19 @@ export default component$(() => {
]);
});

const allProjects = useComputed$(() => [
...(homeData.featured ? [homeData.featured] : []),
...(homeData.newAndShiny ?? []),
...(homeData.trendZone ?? []),
...(homeData.madeWithTailwind ?? []),
...(yourPicks.value ?? []),
...(recentlyVisited.value ?? []),
]);
const projectIds = useComputed$(() =>
allProjects.value.map((project) => project.$id)
);
useUpvotes(projectIds);

return (
<>
<div class="u-flex-vertical u-gap-32 u-margin-block-start-16">
Expand Down

2 comments on commit 5470234

@vercel
Copy link

@vercel vercel bot commented on 5470234 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5470234 Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.