We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19b0e8c commit 92ddfe5Copy full SHA for 92ddfe5
apps/web/src/app/(app)/pages/_components/page-editor.tsx
@@ -21,6 +21,8 @@ export function PageEditor({
21
debounceTime = 200,
22
}: PageEditorProps) {
23
const trpc = useTRPC();
24
+ const pendingChangesRef = useRef<BlockTransaction[]>([]);
25
+
26
const { mutate, isPending } = useMutation({
27
...trpc.blocks.saveTransactions.mutationOptions({}),
28
onSuccess: () => {
@@ -29,7 +31,7 @@ export function PageEditor({
29
31
}
30
32
},
33
});
- const pendingChangesRef = useRef<BlockTransaction[]>([]);
34
35
const debouncedMutate = useDebouncedCallback(() => {
36
if (isPending) return;
37
const transactions = pendingChangesRef.current;
0 commit comments