Skip to content

Commit ccf3478

Browse files
committed
fix: convert var to zero when undefined
1 parent b76a20b commit ccf3478

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/super-editor/src/components/toolbar/super-toolbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ export class SuperToolbar extends EventEmitter {
804804

805805
if (this.activeEditor.options.ydoc) {
806806
const undoManager = yUndoPluginKey.getState(this.activeEditor.state)?.undoManager;
807-
this.undoDepth = undoManager?.undoStack.length;
808-
this.redoDepth = undoManager?.redoStack.length;
807+
this.undoDepth = undoManager?.undoStack.length || 0;
808+
this.redoDepth = undoManager?.redoStack.length || 0;
809809
} else {
810810
this.undoDepth = undoDepth(this.activeEditor.state);
811811
this.redoDepth = redoDepth(this.activeEditor.state);

0 commit comments

Comments
 (0)