Spaces:
Sleeping
Sleeping
try
Browse files- patches/convex/world.ts +3 -2
patches/convex/world.ts
CHANGED
|
@@ -106,6 +106,7 @@ export const userStatus = query({
|
|
| 106 |
if (!oauthToken) {
|
| 107 |
return null;
|
| 108 |
}
|
|
|
|
| 109 |
|
| 110 |
return oauthToken;
|
| 111 |
},
|
|
@@ -139,18 +140,18 @@ export const joinWorld = mutation({
|
|
| 139 |
}
|
| 140 |
// Select a random character description
|
| 141 |
const randomCharacter = characters[Math.floor(Math.random() * characters.length)];
|
| 142 |
-
|
| 143 |
return await insertInput(ctx, world._id, 'join', {
|
| 144 |
name: randomCharacter.name,
|
| 145 |
character: randomCharacter.character,
|
| 146 |
description: randomCharacter.identity,
|
| 147 |
-
plan: randomCharacter.plan,
|
| 148 |
tokenIdentifier: oauthToken,
|
| 149 |
role: "villager",
|
| 150 |
});
|
| 151 |
},
|
| 152 |
});
|
| 153 |
|
|
|
|
| 154 |
export const leaveWorld = mutation({
|
| 155 |
args: {
|
| 156 |
worldId: v.id('worlds'),
|
|
|
|
| 106 |
if (!oauthToken) {
|
| 107 |
return null;
|
| 108 |
}
|
| 109 |
+
|
| 110 |
|
| 111 |
return oauthToken;
|
| 112 |
},
|
|
|
|
| 140 |
}
|
| 141 |
// Select a random character description
|
| 142 |
const randomCharacter = characters[Math.floor(Math.random() * characters.length)];
|
| 143 |
+
|
| 144 |
return await insertInput(ctx, world._id, 'join', {
|
| 145 |
name: randomCharacter.name,
|
| 146 |
character: randomCharacter.character,
|
| 147 |
description: randomCharacter.identity,
|
|
|
|
| 148 |
tokenIdentifier: oauthToken,
|
| 149 |
role: "villager",
|
| 150 |
});
|
| 151 |
},
|
| 152 |
});
|
| 153 |
|
| 154 |
+
|
| 155 |
export const leaveWorld = mutation({
|
| 156 |
args: {
|
| 157 |
worldId: v.id('worlds'),
|