1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-05 15:22:09 +03:00

Null guard space hierarchy (#7729)

This commit is contained in:
Michael Telatynski
2022-02-07 13:48:35 +00:00
committed by GitHub
parent 5d89230271
commit 30e80aa87d

View File

@@ -475,7 +475,7 @@ const INITIAL_PAGE_SIZE = 20;
export const useRoomHierarchy = (space: Room): {
loading: boolean;
rooms: IHierarchyRoom[];
rooms?: IHierarchyRoom[];
hierarchy: RoomHierarchy;
error: Error;
loadMore(pageSize?: number): Promise<void>;
@@ -716,7 +716,7 @@ const SpaceHierarchy = ({
return <RovingTabIndexProvider onKeyDown={onKeyDown} handleHomeEnd handleUpDown>
{ ({ onKeyDownHandler }) => {
let content: JSX.Element;
if (loading && !rooms.length) {
if (loading && !rooms?.length) {
content = <Spinner />;
} else {
const hasPermissions = space?.getMyMembership() === "join" &&