redo of infoPanelStore calculateIsRoom to setIsRoom
This commit is contained in:
parent
bedf1eb969
commit
e191023768
@ -25,7 +25,7 @@ const InfoPanelBodyContent = ({
|
||||
|
||||
isRoom,
|
||||
roomState,
|
||||
calculateisRoom,
|
||||
setIsRoom,
|
||||
|
||||
getFolderInfo,
|
||||
onSelectItem,
|
||||
@ -113,7 +113,7 @@ const InfoPanelBodyContent = ({
|
||||
const selection = getSelection();
|
||||
|
||||
useEffect(() => {
|
||||
calculateisRoom(selection.isRoom);
|
||||
setIsRoom(selection.isRoom);
|
||||
}, [selection]);
|
||||
|
||||
return (
|
||||
@ -162,7 +162,7 @@ export default inject(
|
||||
oformsStore,
|
||||
}) => {
|
||||
const { personal, culture } = auth.settingsStore;
|
||||
const { roomState, isRoom, calculateisRoom } = auth.infoPanelStore;
|
||||
const { roomState, isRoom, setIsRoom } = auth.infoPanelStore;
|
||||
const selfId = auth.userStore.user.id;
|
||||
|
||||
const {
|
||||
@ -219,7 +219,7 @@ export default inject(
|
||||
|
||||
isRoom,
|
||||
roomState,
|
||||
calculateisRoom,
|
||||
setIsRoom,
|
||||
|
||||
getFolderInfo,
|
||||
onSelectItem,
|
||||
|
@ -12,18 +12,6 @@ class InfoPanelStore {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
calculateisRoom = (selectedItem) => {
|
||||
const categoryType = getCategoryType(location);
|
||||
const isRoomCategory =
|
||||
categoryType == CategoryType.Shared ||
|
||||
categoryType == CategoryType.SharedRoom ||
|
||||
categoryType == CategoryType.Archive ||
|
||||
categoryType == CategoryType.ArchivedRoom;
|
||||
const isRoomItem = selectedItem.isRoom;
|
||||
|
||||
this.isRoom = isRoomCategory && isRoomItem;
|
||||
};
|
||||
|
||||
setIsRoom = (isRoom) => {
|
||||
this.isRoom = isRoom;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user