Skip to content

Commit dae2ce4

Browse files
nikgrafCopilot
andauthored
fix listing public spaces in case there is one without a name (#407)
Co-authored-by: Copilot <[email protected]>
1 parent 5375a0d commit dae2ce4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/connect/src/hooks/use-public-spaces.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type SpaceQueryResult = {
2323
personalAddress: string;
2424
page: {
2525
name: string;
26-
};
26+
} | null;
2727
};
2828

2929
type PublicSpacesQueryResult = {
@@ -35,7 +35,7 @@ export type PublicSpaceData = {
3535
type: string;
3636
mainVotingAddress: string;
3737
personalAddress: string;
38-
name: string;
38+
name: string | undefined;
3939
};
4040

4141
export const usePublicSpaces = (url: string): UseQueryResult<PublicSpaceData[], Error> => {
@@ -50,7 +50,7 @@ export const usePublicSpaces = (url: string): UseQueryResult<PublicSpaceData[],
5050
return result?.spaces
5151
? result.spaces.map((space: SpaceQueryResult) => ({
5252
id: space.id,
53-
name: space.page.name,
53+
name: space.page?.name,
5454
type: space.type,
5555
mainVotingAddress: space.mainVotingAddress,
5656
personalAddress: space.personalAddress,

0 commit comments

Comments
 (0)