Skip to content

Commit 01929c4

Browse files
authored
requiring round metadata and roundtype to filter (#3629)
* requiring round metadata and roundtype to filter * updating second filter
1 parent 932f840 commit 01929c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/grant-explorer/src/features/api/rounds.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const OVERRIDE_PRIVATE_ROUND_IDS = [
6464
export const filterOutPrivateRounds = (rounds: RoundGetRound[]) => {
6565
return rounds.filter(
6666
(round) =>
67+
(round.roundMetadata && round.roundMetadata.roundType) &&
6768
round.roundMetadata.roundType !== "private" ||
6869
OVERRIDE_PRIVATE_ROUND_IDS.includes(round.id.toLowerCase())
6970
);

packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const ExploreRoundsPage = () => {
1919
// Pass the filter from the search params and build the graphql query
2020
const rounds = useFilterRounds(filter, getEnabledChains());
2121

22-
const publicRounds = useMemo(() => rounds.data?.filter(round => round.roundMetadata.roundType?.toLowerCase() !== "private"), [rounds]);
22+
const publicRounds = useMemo(() => rounds.data?.filter(round => (round.roundMetadata && round.roundMetadata.roundType) && round.roundMetadata.roundType?.toLowerCase() !== "private"), [rounds]);
2323
rounds.data = publicRounds;
2424

2525
const sectionTitle = getExplorerPageTitle(filter);

0 commit comments

Comments
 (0)