feat: 删除歌曲行数据时改用 onClose 来处理
This commit is contained in:
parent
b8c3a51756
commit
eaf05d8cbb
@ -25,7 +25,7 @@ interface FileRowProps {
|
||||
}
|
||||
|
||||
export function FileRow({ id, file }: FileRowProps) {
|
||||
const { isOpen, onToggle } = useDisclosure({ defaultIsOpen: true });
|
||||
const { isOpen, onClose } = useDisclosure({ defaultIsOpen: true });
|
||||
const dispatch = useAppDispatch();
|
||||
const isDecrypted = file.state === ProcessState.COMPLETE;
|
||||
|
||||
@ -47,11 +47,11 @@ export function FileRow({ id, file }: FileRowProps) {
|
||||
}, []);
|
||||
|
||||
const handleDeleteRow = useCallback(() => {
|
||||
onToggle();
|
||||
onClose();
|
||||
setTimeout(() => {
|
||||
dispatch(deleteFile({ id }));
|
||||
}, 500);
|
||||
}, [dispatch, id, onToggle]);
|
||||
}, [dispatch, id, onClose]);
|
||||
|
||||
return (
|
||||
<Collapse in={isOpen} animateOpacity unmountOnExit startingHeight={0} style={{ width: '100%' }}>
|
||||
|
Loading…
Reference in New Issue
Block a user