Client: Fixed crash in public room
This commit is contained in:
parent
ee7fe469b2
commit
f3c183b800
@ -133,9 +133,9 @@ export const useOptions = (
|
||||
newFilter.searchArea = RoomSearchArea.Active;
|
||||
|
||||
const state = {
|
||||
title: roomsFolder.title,
|
||||
title: roomsFolder?.title,
|
||||
isRoot: true,
|
||||
rootFolderType: roomsFolder.rootFolderType,
|
||||
rootFolderType: roomsFolder?.rootFolderType,
|
||||
};
|
||||
|
||||
const path = getCategoryUrl(CategoryType.Shared);
|
||||
@ -146,7 +146,7 @@ export const useOptions = (
|
||||
},
|
||||
state,
|
||||
};
|
||||
}, [roomsFolder.rootFolderType, roomsFolder.title, userId]);
|
||||
}, [roomsFolder?.rootFolderType, roomsFolder?.title, userId]);
|
||||
|
||||
const onGoToPersonal = useCallback((): LinkProps => {
|
||||
const newFilter = FilesFilter.getDefault();
|
||||
@ -154,9 +154,9 @@ export const useOptions = (
|
||||
newFilter.folder = myFolderId?.toString() ?? "";
|
||||
|
||||
const state = {
|
||||
title: myFolder.title,
|
||||
title: myFolder?.title,
|
||||
isRoot: true,
|
||||
rootFolderType: myFolder.rootFolderType,
|
||||
rootFolderType: myFolder?.rootFolderType,
|
||||
};
|
||||
|
||||
const path = getCategoryUrl(CategoryType.Personal);
|
||||
@ -170,7 +170,7 @@ export const useOptions = (
|
||||
},
|
||||
state,
|
||||
};
|
||||
}, [myFolder.rootFolderType, myFolder.title, myFolderId]);
|
||||
}, [myFolder?.rootFolderType, myFolder?.title, myFolderId]);
|
||||
|
||||
const onCreateRoom = useCallback(() => {
|
||||
if (isWarningRoomsDialog) {
|
||||
|
@ -179,6 +179,9 @@ class TreeFoldersStore {
|
||||
return this.rootFoldersTitles[FolderType.TRASH]?.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("@docspace/shared/api/files/types").TFolder=}
|
||||
*/
|
||||
get myFolder() {
|
||||
return this.treeFolders.find((x) => x.rootFolderType === FolderType.USER);
|
||||
}
|
||||
@ -196,7 +199,9 @@ class TreeFoldersStore {
|
||||
get recentFolder() {
|
||||
return this.treeFolders.find((x) => x.rootFolderType === FolderType.Recent);
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("@docspace/shared/api/rooms/types").TRoom=}
|
||||
*/
|
||||
get roomsFolder() {
|
||||
return this.treeFolders.find((x) => x.rootFolderType === FolderType.Rooms);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user