diff --git a/client/svelte-client/src/components/NetworkSessionWrapper.svelte b/client/svelte-client/src/components/NetworkSessionWrapper.svelte
index 8b29ec8..d90aabc 100644
--- a/client/svelte-client/src/components/NetworkSessionWrapper.svelte
+++ b/client/svelte-client/src/components/NetworkSessionWrapper.svelte
@@ -28,7 +28,6 @@
{#if !session}
no session
{:else}
- {JSON.stringify(session)}
{JSON.stringify($sessionEvents)}
{#if session.state === SessionState.PENDING}
waiting for other player...
diff --git a/client/svelte-client/src/store/session.ts b/client/svelte-client/src/store/session.ts
index fa1e537..4888434 100644
--- a/client/svelte-client/src/store/session.ts
+++ b/client/svelte-client/src/store/session.ts
@@ -84,12 +84,14 @@ const networkEvents = (session: NetworkSession) => readable([], function(set) {
})
export const networkSessionStateEvents = (session: NetworkSession): Readable => derived(networkEvents(session), $sessionEvents => {
+ console.log("test")
const sessionEvents = $sessionEvents.filter(({topic}) => topic === 'session').map(({event}) => event);
if (!sessionEvents.length) {
return [];
}
const latestSessionEvent = sessionEvents[sessionEvents.length-1];
- const session = {...latestSessionEvent.session, you: latestSessionEvent.actor, type: get(sessionStore).type}
+ const currentSession = get(sessionStore) as NetworkSession;
+ const session = {...latestSessionEvent.session, you: currentSession.you, type: currentSession.type}
console.debug("updating current session: ", session)
sessionStore.set(session);
return sessionEvents;