redo of infoPanelStore calculateIsRoom to setIsRoom

This commit is contained in:
mushka 2022-09-01 04:38:26 +03:00
parent bedf1eb969
commit e191023768
2 changed files with 4 additions and 16 deletions

View File

@ -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,

View File

@ -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;
};