Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Jun 17, 2024
1 parent 7a0c587 commit b608532
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/pages/DaoDashboard/Activities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function Activities() {
governance: { type, loadingProposals, allProposalsLoaded },
} = useFractal();
const [sortBy, setSortBy] = useState<SortBy>(SortBy.Newest);

const { sortedActivities } = useActivities(sortBy);

const { t } = useTranslation('dashboard');
Expand Down
8 changes: 3 additions & 5 deletions src/hooks/DAO/proposal/useProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ export default function useProposals({
);

const sortedAndFilteredProposals = useMemo(() => {
return (proposals || [])
.filter(proposal => {
return filters.includes(proposal.state!);
})
return [...(proposals || [])]
.filter(proposal => filters.includes(proposal.state!))
.sort((a, b) => {
const dataA = new Date(a.eventDate).getTime();
const dataB = new Date(b.eventDate).getTime();
Expand All @@ -35,7 +33,7 @@ export default function useProposals({
}
return dataB - dataA;
});
}, [proposals, filters, sortBy]);
}, [sortBy, filters, proposals]);

return {
proposals: sortedAndFilteredProposals,
Expand Down

0 comments on commit b608532

Please sign in to comment.