fix space manage
This commit is contained in:
parent
197b15eb6d
commit
212f18b69c
2 changed files with 3 additions and 12 deletions
|
@ -290,19 +290,11 @@ function SpaceManageContent({ roomId, requestClose }) {
|
|||
const [spacePath, addPathItem] = useSpacePath(roomId);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [selected, setSelected] = useState([]);
|
||||
const mountStore = useStore();
|
||||
const currentPath = spacePath[spacePath.length - 1];
|
||||
useChildUpdate(currentPath.roomId, roomsHierarchy);
|
||||
|
||||
const currentHierarchy = roomsHierarchy.getHierarchy(currentPath.roomId);
|
||||
|
||||
useEffect(() => {
|
||||
mountStore.setItem(true);
|
||||
return () => {
|
||||
mountStore.setItem(false);
|
||||
};
|
||||
}, [roomId]);
|
||||
|
||||
useEffect(() => setSelected([]), [spacePath]);
|
||||
|
||||
const handleSelected = (selectedRoomId) => {
|
||||
|
@ -324,11 +316,9 @@ function SpaceManageContent({ roomId, requestClose }) {
|
|||
setIsLoading(true);
|
||||
try {
|
||||
await roomsHierarchy.load(currentPath.roomId);
|
||||
if (!mountStore.getItem()) return;
|
||||
setIsLoading(false);
|
||||
forceUpdate();
|
||||
} catch {
|
||||
if (!mountStore.getItem()) return;
|
||||
} catch(O_o) {
|
||||
setIsLoading(false);
|
||||
forceUpdate();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@ class RoomsHierarchy {
|
|||
try {
|
||||
await roomHierarchy.load(limit);
|
||||
return roomHierarchy.rooms;
|
||||
} catch {
|
||||
} catch (o_O) {
|
||||
console.error(o_O);
|
||||
return roomHierarchy.rooms;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue