Skip to content

Commit a0639de

Browse files
author
Bobby
committed
fix(immediate-mode): only remove docs if still in the list
1 parent 0bc00b1 commit a0639de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/reducers/cacheReducer.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,10 @@ const remove = (state, { action, key, path }) =>
687687
// remove document id from ordered index
688688
if (draft[key] && draft[key].ordered) {
689689
const idx = findIndex(draft[key].ordered, [1, action.meta.doc]);
690-
draft[key].ordered.splice(idx, 1);
690+
const wasNotAlreadyRemoved = idx !== -1;
691+
if (wasNotAlreadyRemoved) {
692+
draft[key].ordered.splice(idx, 1);
693+
}
691694
}
692695

693696
// reprocess

0 commit comments

Comments
 (0)