Skip to content

Commit 160c17a

Browse files
committed
Set user state before sending deck list
1 parent 2f2507b commit 160c17a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

functions/server-bot/on-message.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ export const onMessage = (envSafe: EnvSafe) => async (ctx: Context) => {
3939
);
4040
return;
4141
}
42-
const [decks] = await Promise.all([
43-
getDecksCreatedByMe(envSafe, ctx.from.id),
44-
userSetServerBotState(envSafe, ctx.from.id, {
45-
type: "cardAdded",
46-
cardFront: cardAsText.front,
47-
cardBack: cardAsText.back,
48-
}),
49-
]);
42+
await userSetServerBotState(envSafe, ctx.from.id, {
43+
type: "cardAdded",
44+
cardFront: cardAsText.front,
45+
cardBack: cardAsText.back,
46+
});
47+
const decks = await getDecksCreatedByMe(envSafe, ctx.from.id);
5048

5149
await ctx.reply("To create a card from it, select a deck: ", {
5250
reply_markup: InlineKeyboard.from(

0 commit comments

Comments
 (0)