diff --git a/apps/events/src/components/debug-invitations.tsx b/apps/events/src/components/debug-invitations.tsx
index d940c611..8b262315 100644
--- a/apps/events/src/components/debug-invitations.tsx
+++ b/apps/events/src/components/debug-invitations.tsx
@@ -1,7 +1,12 @@
import type { Invitation } from 'graph-framework';
import { Button } from './ui/button';
-export function DebugInvitations({ invitations }: { invitations: Invitation[] }) {
+type Props = {
+ invitations: Invitation[];
+ accept: (invitation: Invitation) => void;
+};
+
+export function DebugInvitations({ invitations, accept }: Props) {
return (
{invitations.map((invitation) => {
@@ -10,7 +15,7 @@ export function DebugInvitations({ invitations }: { invitations: Invitation[] })
{JSON.stringify(invitation, null, 2)}
Invitations
-
+ {
+ const spaceEvent = await Effect.runPromiseExit(
+ acceptInvitation({
+ author: {
+ signaturePublicKey: accountId,
+ encryptionPublicKey,
+ signaturePrivateKey,
+ },
+ previousEventHash: invitation.previousEventHash,
+ }),
+ );
+ if (Exit.isFailure(spaceEvent)) {
+ console.error('Failed to accept invitation', spaceEvent);
+ return;
+ }
+ const message: EventMessage = { type: 'event', event: spaceEvent.value, spaceId: invitation.spaceId };
+ websocketConnection?.send(JSON.stringify(message));
+ }}
+ />
Spaces