Skip to content

Commit 5e60702

Browse files
author
Wojtach
committed
fix: added handling replicator document change tokens
1 parent 93b11e7 commit 5e60702

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

expo-example/app/replication/documentStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export default function DocumentReplicationScreen() {
3535
...prev,
3636
`::Information: Replicator <${replicatorId}> Starting Document Change listener...`,
3737
]);
38-
const date = new Date().toISOString();
3938
const changeToken = await replicator.addDocumentChangeListener((documentReplication) => {
39+
const date = new Date().toISOString();
4040
const docs = documentReplication.documents;
4141
const direction = documentReplication.isPush ? 'PUSH' : 'PULL';
4242

@@ -100,7 +100,7 @@ export default function DocumentReplicationScreen() {
100100
...prev,
101101
`::Information: Removing document change listener with token <${token}> from Replicator with replicatorId: <${replicatorId}>.`,
102102
]);
103-
// await replicator.removeDocumentChangeListener(token);
103+
await replicator.removeChangeListener(token);
104104

105105
setDocumentTokens((prev) => {
106106
const newTokens = { ...prev };

expo-example/hooks/useReplicationNavigationSections.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function useReplicationNavigationSections() {
2020
path: '/replication/stop',
2121
},
2222
{
23-
id: 3,
23+
id: 4,
2424
title: 'Replicator Documents Status',
2525
path: '/replication/documentStatus',
2626
},

src/cblite-js

0 commit comments

Comments
 (0)