From a69b810153e277b08a1c2d9d634b54227eec3043 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 17 Nov 2021 12:16:18 +0000 Subject: [PATCH 1/2] Show space members when not invited even if summary didn't fail --- src/components/structures/SpaceRoomView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index becd05b9c99..96bda302e2c 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -156,7 +156,7 @@ const SpaceInfo = ({ space }: { space: Room }) => { memberSection = { _t("%(count)s members", { count: summary.num_joined_members }) } ; - } else if (summary === null) { + } else if (summary !== undefined) { memberSection = { (count) => count > 0 ? ( Date: Fri, 19 Nov 2021 10:10:19 +0000 Subject: [PATCH 2/2] add comments --- src/components/structures/SpaceRoomView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 96bda302e2c..da9834d2adb 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -128,6 +128,7 @@ const useMyRoomMembership = (room: Room) => { }; const SpaceInfo = ({ space }: { space: Room }) => { + // summary will begin as undefined whilst loading and go null if it fails to load. const summary = useAsyncMemo(async () => { if (space.getMyMembership() !== "invite") return; try { @@ -156,7 +157,7 @@ const SpaceInfo = ({ space }: { space: Room }) => { memberSection = { _t("%(count)s members", { count: summary.num_joined_members }) } ; - } else if (summary !== undefined) { + } else if (summary !== undefined) { // summary is not still loading memberSection = { (count) => count > 0 ? (