From 212f18b69c4ab7c29f43fd4d91b5e73035a51590 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Sun, 26 Mar 2023 01:06:03 +0200 Subject: [PATCH] fix space manage --- src/app/organisms/space-manage/SpaceManage.jsx | 12 +----------- src/client/state/RoomsHierarchy.js | 3 ++- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/app/organisms/space-manage/SpaceManage.jsx b/src/app/organisms/space-manage/SpaceManage.jsx index 1cef6a2..ef41e61 100644 --- a/src/app/organisms/space-manage/SpaceManage.jsx +++ b/src/app/organisms/space-manage/SpaceManage.jsx @@ -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(); } diff --git a/src/client/state/RoomsHierarchy.js b/src/client/state/RoomsHierarchy.js index f3ffb1f..253a585 100644 --- a/src/client/state/RoomsHierarchy.js +++ b/src/client/state/RoomsHierarchy.js @@ -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; } }