a tool for shared writing and social publishing

fixed some undo redo bugs

+8 -1
+1 -1
components/Pages/PageOptions.tsx
··· 93 93 94 94 <PageOptionButton 95 95 secondary 96 - onClick={() => undoManager.undo()} 96 + onClick={() => undoManager.redo()} 97 97 disabled={!undoState.canRedo} 98 98 > 99 99 <RedoTiny />
+7
src/replicache/clientMutationContext.ts
··· 67 67 textData.value = base64.fromByteArray(updateBytes); 68 68 } 69 69 } 70 + } else if (f.id) { 71 + // For cardinality "many" with an explicit ID, fetch the existing fact 72 + // so undo can restore it instead of deleting 73 + let fact = await tx.get(f.id); 74 + if (fact) { 75 + existingFact = [fact as Fact<any>]; 76 + } 70 77 } 71 78 if (!ignoreUndo) 72 79 undoManager.add({