Skip to content

Commit aa78890

Browse files
author
gemini2035
committed
feat: optimized the way in change operation
1 parent f2e8f5d commit aa78890

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/editor/action/EditorActionAdd.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ export const EditorActionAdd = ({
100100
[type],
101101
)
102102

103+
useEffect(() => {
104+
if (editingAction?.type) {
105+
setValue('type', editingAction.type)
106+
}
107+
// eslint-disable-next-line react-hooks/exhaustive-deps
108+
}, [editingAction?._id, setValue])
109+
103110
useEffect(() => {
104111
if (editingAction) {
105112
// 修复切换type的时候,数据丢失的问题

0 commit comments

Comments
 (0)