Skip to content

Commit 6a9e67e

Browse files
committed
Push to servers when claims are created or requests are verified
1 parent adc16c3 commit 6a9e67e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

apps/polycentric/src/features/verifications/hooks/useCreateClaim.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export default function useCreateClaim() {
7171
// Save the event locally and mirror it (with content) into the core.
7272
await client.commitEvent(signedEvent, content);
7373

74+
try {
75+
await client.sync(SyncStrategy.PARTIAL_PUSH);
76+
} catch (err) {
77+
console.error(err);
78+
}
79+
7480
// The same sync below delivers both events.
7581
if (requestFrom && event.key) {
7682
await publishVerificationTarget(client, event.key, requestFrom);

apps/polycentric/src/features/verifications/hooks/useRequestVerification.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export async function publishVerificationTarget(
3131
const event = await client.buildEvent(content, COLLECTION.VERIFICATIONS);
3232
const signedEvent = await client.signEvent(event);
3333
await client.commitEvent(signedEvent, content);
34+
try {
35+
await client.sync(SyncStrategy.PARTIAL_PUSH);
36+
} catch (err) {
37+
console.error(err);
38+
}
3439
}
3540

3641
// Request verification of an existing claim from a specific identity.

0 commit comments

Comments
 (0)