Please sync invitatinos
This commit is contained in:
@@ -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...');
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user