From d433a6b804209c0b2e177350ff874f9c86f0f90d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 31 Oct 2025 12:53:37 +0000 Subject: [PATCH] Add comments in lieu of type and fix else block --- src/components/structures/MatrixChat.tsx | 6 ++---- src/stores/spaces/index.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index c3c358d66b..0365b4b583 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1924,10 +1924,8 @@ export default class MatrixChat extends React.PureComponent { userId: userId, subAction: params?.action, }); - } else { - if (ModuleApi.instance.navigation.locationRenderers.get(screen)) { - this.setState({ page_type: screen }); - } + } else if (ModuleApi.instance.navigation.locationRenderers.get(screen)) { + this.setState({ page_type: screen }); } } diff --git a/src/stores/spaces/index.ts b/src/stores/spaces/index.ts index d05435b587..fb642b638d 100644 --- a/src/stores/spaces/index.ts +++ b/src/stores/spaces/index.ts @@ -42,6 +42,14 @@ export const getMetaSpaceName = (spaceKey: MetaSpace, allRoomsInHome = false): s } }; +/** + * This can be: + * - a MetaSpace + * - space ID (ie. a room ID) + * - A 'custom' space from a module + * Unfortunately we can't type the last set as we don't know what modules will define, + * so we can't do better than string here. + */ export type SpaceKey = string; export interface ISuggestedRoom extends HierarchyRoom {