mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 14:46:13 +00:00
fix(Filter-blocks): should remove option when deleting block
This commit is contained in:
parent
070c9c21ec
commit
815768c91d
@ -78,7 +78,7 @@ export const FilterBlockRecord = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
removeDataBlock(field.props.name as string);
|
removeDataBlock(fieldSchema['x-uid']);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -113,8 +113,8 @@ export const useFilterBlock = () => {
|
|||||||
setDataBlocks((prev) => [...prev, block]);
|
setDataBlocks((prev) => [...prev, block]);
|
||||||
};
|
};
|
||||||
const getDataBlocks = () => dataBlocks;
|
const getDataBlocks = () => dataBlocks;
|
||||||
const removeDataBlock = (name: string) => {
|
const removeDataBlock = (uid: string) => {
|
||||||
setDataBlocks((prev) => prev.filter((item) => item.uid !== name));
|
setDataBlocks((prev) => prev.filter((item) => item.uid !== uid));
|
||||||
};
|
};
|
||||||
|
|
||||||
return { recordDataBlocks, getDataBlocks, removeDataBlock };
|
return { recordDataBlocks, getDataBlocks, removeDataBlock };
|
||||||
|
Loading…
Reference in New Issue
Block a user