Jofthomas HF staff commited on
Commit
2ccebeb
1 Parent(s): 1620562
Files changed (1) hide show
  1. convex/world.ts +3 -2
convex/world.ts CHANGED
@@ -142,7 +142,7 @@ export const joinWorld = mutation({
142
  throw new ConvexError(`Invalid world ID: ${args.worldId}`);
143
  }
144
 
145
- const playerIds = [...world.playersInit.values()].map(player => player.id)
146
 
147
  const playerDescriptions = await ctx.db
148
  .query('playerDescriptions')
@@ -192,7 +192,8 @@ export const leaveWorld = mutation({
192
  throw new Error(`Invalid world ID: ${args.worldId}`);
193
  }
194
  // const existingPlayer = world.players.find((p) => p.human === tokenIdentifier);
195
- const existingPlayer = world.playersInit.find((p) => p.human === oauthToken);
 
196
  if (!existingPlayer) {
197
  return;
198
  }
 
142
  throw new ConvexError(`Invalid world ID: ${args.worldId}`);
143
  }
144
 
145
+ const playerIds = [...world.players.values()].map(player => player.id)
146
 
147
  const playerDescriptions = await ctx.db
148
  .query('playerDescriptions')
 
192
  throw new Error(`Invalid world ID: ${args.worldId}`);
193
  }
194
  // const existingPlayer = world.players.find((p) => p.human === tokenIdentifier);
195
+ const existingPlayer = world.players.find((p) => p.human === oauthToken);
196
+ console.log("existingPlayer :",existingPlayer)
197
  if (!existingPlayer) {
198
  return;
199
  }