Client:FilesSelector: fix disabled items

This commit is contained in:
Timofey Boyko 2024-05-27 17:24:22 +03:00
parent 2eb8bda527
commit 2200c6fa0e

View File

@ -56,7 +56,7 @@ import InfoPanelStore from "SRC_DIR/store/InfoPanelStore";
import { FilesSelectorProps } from "./FilesSelector.types"; import { FilesSelectorProps } from "./FilesSelector.types";
import { getAcceptButtonLabel, getHeaderLabel, getIsDisabled } from "./utils"; import { getAcceptButtonLabel, getHeaderLabel, getIsDisabled } from "./utils";
const disabledItems: (string | number)[] = []; let disabledItems: (string | number)[] = [];
const FilesSelectorWrapper = ({ const FilesSelectorWrapper = ({
isPanelVisible = false, isPanelVisible = false,
@ -177,6 +177,12 @@ const FilesSelectorWrapper = ({
[t], [t],
); );
React.useEffect(() => {
return () => {
disabledItems = [];
};
}, []);
const onAccept = async ( const onAccept = async (
selectedItemId: string | number | undefined, selectedItemId: string | number | undefined,
folderTitle: string, folderTitle: string,