Fix handleColorChange when no redo action is recorded (#538)

This commit is contained in:
1ilit
2025-07-23 22:23:51 +04:00
committed by GitHub
parent 24d56cc7bf
commit 0e196de261
5 changed files with 5 additions and 5 deletions

View File

@@ -231,7 +231,7 @@ function EditPopoverContent({ data }) {
e.element === ObjectType.AREA &&
e.aid === data.id &&
e.action === Action.EDIT &&
e.redo.color,
e.redo?.color,
);
if (lastColorChange) {
undoColor = lastColorChange.redo.color;

View File

@@ -42,7 +42,7 @@ export default function Note({ data, onPointerDown }) {
e.element === ObjectType.NOTE &&
e.nid === data.id &&
e.action === Action.EDIT &&
e.redo.color,
e.redo?.color,
);
if (lastColorChange) {
undoColor = lastColorChange.redo.color;

View File

@@ -21,7 +21,7 @@ export default function AreaInfo({ data, i }) {
e.element === ObjectType.AREA &&
e.aid === data.id &&
e.action === Action.EDIT &&
e.redo.color,
e.redo?.color,
);
if (lastColorChange) {
undoColor = lastColorChange.redo.color;

View File

@@ -21,7 +21,7 @@ export default function NoteInfo({ data, nid }) {
e.element === ObjectType.NOTE &&
e.nid === data.id &&
e.action === Action.EDIT &&
e.redo.color,
e.redo?.color,
);
if (lastColorChange) {
undoColor = lastColorChange.redo.color;

View File

@@ -35,7 +35,7 @@ export default function TableInfo({ data }) {
e.element === ObjectType.TABLE &&
e.tid === data.id &&
e.action === Action.EDIT &&
e.redo.color,
e.redo?.color,
);
if (lastColorChange) {
undoColor = lastColorChange.redo.color;