mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-02-12 02:00:40 +08:00
Fix field type not updating when enum name is changed (#193 part2)
This commit is contained in:
@@ -308,6 +308,13 @@ export default function ControlPanel({
|
||||
}
|
||||
} else if (a.element === ObjectType.ENUM) {
|
||||
updateEnum(a.id, a.undo);
|
||||
if (a.updatedFields) {
|
||||
if (a.undo.name) {
|
||||
a.updatedFields.forEach((x) =>
|
||||
updateField(x.tid, x.fid, { type: a.undo.name.toUpperCase() }),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
setRedoStack((prev) => [...prev, a]);
|
||||
} else if (a.action === Action.PAN) {
|
||||
@@ -477,6 +484,13 @@ export default function ControlPanel({
|
||||
}
|
||||
} else if (a.element === ObjectType.ENUM) {
|
||||
updateEnum(a.id, a.redo);
|
||||
if (a.updatedFields) {
|
||||
if (a.redo.name) {
|
||||
a.updatedFields.forEach((x) =>
|
||||
updateField(x.tid, x.fid, { type: a.redo.name.toUpperCase() }),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
setUndoStack((prev) => [...prev, a]);
|
||||
} else if (a.action === Action.PAN) {
|
||||
|
||||
Reference in New Issue
Block a user