Skip to content

Commit 2e5abad

Browse files
committed
1 parent 3f1746f commit 2e5abad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ are implemented in separate modules.
148148
| [Slate](https://github.com/ianstormtaylor/slate) || [slate-yjs](https://github.com/bitphinix/slate-yjs) | [demo](https://bitphinix.github.io/slate-yjs-example) |
149149
| [BlockSuite](https://github.com/toeverything/blocksuite) || (native) | [demo](https://blocksuite-toeverything.vercel.app/?init) |
150150
| [Lexical](https://lexical.dev/) || (native) | [demo](https://lexical.dev/docs/collaboration/react#see-it-in-action) |
151-
152151
| [valtio](https://github.com/pmndrs/valtio) | | [valtio-yjs](https://github.com/dai-shi/valtio-yjs) | [demo](https://codesandbox.io/s/valtio-yjs-demo-ox3iy) |
153152
| [immer](https://github.com/immerjs/immer) | | [immer-yjs](https://github.com/sep2/immer-yjs) | [demo](https://codesandbox.io/s/immer-yjs-demo-6e0znb) |
154153
| React / Vue / Svelte / MobX | | [SyncedStore](https://syncedstore.org) | [demo](https://syncedstore.org/docs/react) |

src/utils/UndoManager.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ const popStackItem = (undoManager, stack, eventType) => {
118118
})
119119
_tr = transaction
120120
}, undoManager)
121-
if (undoManager.currStackItem != null) {
121+
const res = undoManager.currStackItem
122+
if (res != null) {
122123
const changedParentTypes = _tr.changedParentTypes
123-
undoManager.emit('stack-item-popped', [{ stackItem: undoManager.currStackItem, type: eventType, changedParentTypes, origin: undoManager }, undoManager])
124+
undoManager.emit('stack-item-popped', [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager }, undoManager])
124125
undoManager.currStackItem = null
125126
}
126-
return undoManager.currStackItem
127+
return res
127128
}
128129

129130
/**

0 commit comments

Comments
 (0)