ELT: disable reload button by $process

This commit is contained in:
vchikalkin 2023-07-31 12:46:32 +03:00
parent 5f7586bb0d
commit 94a39925d5

View File

@ -7,7 +7,7 @@ import { Flex } from 'ui/grid';
export const ReloadButton = observer(
({ storeSelector, onClick }: { onClick: () => void; storeSelector: StoreSelector }) => {
const { $tables } = useStore();
const { $tables, $process } = useStore();
const { validation, getRows: rows } = storeSelector($tables.elt);
const hasErrors = validation.hasErrors;
@ -16,7 +16,12 @@ export const ReloadButton = observer(
<Flex justifyContent="center">
<Button
onClick={onClick}
disabled={hasErrors}
disabled={
hasErrors ||
$process.has('LoadKP') ||
$process.has('Calculate') ||
$process.has('CreateKP')
}
loading={rows.some((x) => x.status === 'fetching')}
shape="circle"
icon={<ReloadOutlined rev="" />}