Please sync invitatinos

This commit is contained in:
2026-02-23 06:13:12 +00:00
parent 2c547f766a
commit 38a0ac436b
3 changed files with 7 additions and 3 deletions

View File

@@ -196,6 +196,8 @@ export function InvitationScreen(): React.ReactElement {
return; return;
} }
console.log('Importing invitation:', invitationId);
try { try {
setIsLoading(true); setIsLoading(true);
setStatus('Fetching invitation...'); setStatus('Fetching invitation...');

View File

@@ -323,6 +323,8 @@ export function useActionWizard() {
actionIdentifier, actionIdentifier,
}); });
console.log(xoInvitation)
// Wrap and track // Wrap and track
const invitationInstance = const invitationInstance =
await appService.createInvitation(xoInvitation); await appService.createInvitation(xoInvitation);

View File

@@ -1,7 +1,7 @@
import type { XOInvitation } from "@xo-cash/types"; import type { XOInvitation } from "@xo-cash/types";
import { EventEmitter } from "./event-emitter.js"; import { EventEmitter } from "./event-emitter.js";
import { SSESession, type SSEvent } from "./sse-client.js"; import { SSESession, type SSEvent } from "./sse-client.js";
import { decodeExtendedJsonObject, encodeExtendedJson } from "./ext-json.js"; import { decodeExtendedJson, decodeExtendedJsonObject, encodeExtendedJson, encodeExtendedJsonObject } from "./ext-json.js";
export type SyncServerEventMap = { export type SyncServerEventMap = {
'connected': void; 'connected': void;
@@ -66,7 +66,7 @@ export class SyncServer extends EventEmitter<SyncServerEventMap> {
throw new Error(`Failed to get invitation: ${response.statusText}`); throw new Error(`Failed to get invitation: ${response.statusText}`);
} }
const invitation = decodeExtendedJsonObject(await response.text()) as XOInvitation | undefined; const invitation = decodeExtendedJson(await response.text()) as XOInvitation | undefined;
return invitation; return invitation;
} }
@@ -92,7 +92,7 @@ export class SyncServer extends EventEmitter<SyncServerEventMap> {
// Read the returned JSON // Read the returned JSON
// TODO: This should use zod to verify the response // TODO: This should use zod to verify the response
const data = decodeExtendedJsonObject(await response.text()) as XOInvitation; const data = decodeExtendedJson(await response.text()) as XOInvitation;
return data; return data;
} }