mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08:00
Null guard space hierarchy (#7729)
This commit is contained in:
parent
5d89230271
commit
30e80aa87d
@ -475,7 +475,7 @@ const INITIAL_PAGE_SIZE = 20;
|
|||||||
|
|
||||||
export const useRoomHierarchy = (space: Room): {
|
export const useRoomHierarchy = (space: Room): {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
rooms: IHierarchyRoom[];
|
rooms?: IHierarchyRoom[];
|
||||||
hierarchy: RoomHierarchy;
|
hierarchy: RoomHierarchy;
|
||||||
error: Error;
|
error: Error;
|
||||||
loadMore(pageSize?: number): Promise<void>;
|
loadMore(pageSize?: number): Promise<void>;
|
||||||
@ -716,7 +716,7 @@ const SpaceHierarchy = ({
|
|||||||
return <RovingTabIndexProvider onKeyDown={onKeyDown} handleHomeEnd handleUpDown>
|
return <RovingTabIndexProvider onKeyDown={onKeyDown} handleHomeEnd handleUpDown>
|
||||||
{ ({ onKeyDownHandler }) => {
|
{ ({ onKeyDownHandler }) => {
|
||||||
let content: JSX.Element;
|
let content: JSX.Element;
|
||||||
if (loading && !rooms.length) {
|
if (loading && !rooms?.length) {
|
||||||
content = <Spinner />;
|
content = <Spinner />;
|
||||||
} else {
|
} else {
|
||||||
const hasPermissions = space?.getMyMembership() === "join" &&
|
const hasPermissions = space?.getMyMembership() === "join" &&
|
||||||
|
Loading…
Reference in New Issue
Block a user