Skip to content

Commit dd1b8a5

Browse files
1ilitewqazxc
authored andcommitted
Fix handleColorChange when no redo action is recorded (drawdb-io#538)
1 parent 3369abd commit dd1b8a5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/components/EditorCanvas/Area.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function EditPopoverContent({ data }) {
231231
e.element === ObjectType.AREA &&
232232
e.aid === data.id &&
233233
e.action === Action.EDIT &&
234-
e.redo.color,
234+
e.redo?.color,
235235
);
236236
if (lastColorChange) {
237237
undoColor = lastColorChange.redo.color;

src/components/EditorCanvas/Note.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function Note({ data, onPointerDown }) {
4242
e.element === ObjectType.NOTE &&
4343
e.nid === data.id &&
4444
e.action === Action.EDIT &&
45-
e.redo.color,
45+
e.redo?.color,
4646
);
4747
if (lastColorChange) {
4848
undoColor = lastColorChange.redo.color;

src/components/EditorSidePanel/AreasTab/AreaDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function AreaInfo({ data, i }) {
2222
e.element === ObjectType.AREA &&
2323
e.aid === data.id &&
2424
e.action === Action.EDIT &&
25-
e.redo.color,
25+
e.redo?.color,
2626
);
2727
if (lastColorChange) {
2828
undoColor = lastColorChange.redo.color;

src/components/EditorSidePanel/NotesTab/NoteInfo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function NoteInfo({ data, nid }) {
2222
e.element === ObjectType.NOTE &&
2323
e.nid === data.id &&
2424
e.action === Action.EDIT &&
25-
e.redo.color,
25+
e.redo?.color,
2626
);
2727
if (lastColorChange) {
2828
undoColor = lastColorChange.redo.color;

src/components/EditorSidePanel/TablesTab/TableInfo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function TableInfo({ data }) {
3535
e.element === ObjectType.TABLE &&
3636
e.tid === data.id &&
3737
e.action === Action.EDIT &&
38-
e.redo.color,
38+
e.redo?.color,
3939
);
4040
if (lastColorChange) {
4141
undoColor = lastColorChange.redo.color;

0 commit comments

Comments
 (0)