mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:40:50 +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(() => {
|
||||
return () => {
|
||||
removeDataBlock(field.props.name as string);
|
||||
removeDataBlock(fieldSchema['x-uid']);
|
||||
};
|
||||
}, []);
|
||||
|
||||
@ -113,8 +113,8 @@ export const useFilterBlock = () => {
|
||||
setDataBlocks((prev) => [...prev, block]);
|
||||
};
|
||||
const getDataBlocks = () => dataBlocks;
|
||||
const removeDataBlock = (name: string) => {
|
||||
setDataBlocks((prev) => prev.filter((item) => item.uid !== name));
|
||||
const removeDataBlock = (uid: string) => {
|
||||
setDataBlocks((prev) => prev.filter((item) => item.uid !== uid));
|
||||
};
|
||||
|
||||
return { recordDataBlocks, getDataBlocks, removeDataBlock };
|
||||
|
Loading…
Reference in New Issue
Block a user