diff --git a/src/core/game-client.ts b/src/core/game-client.ts index ba7e71c..efae3f5 100644 --- a/src/core/game-client.ts +++ b/src/core/game-client.ts @@ -87,17 +87,20 @@ export abstract class BaseGameClient< } } - callback({ - hasPrompt: true, - player: ctx.player || "global", - def: ctx.def, - tryAnswer, - }); - await next(); - callback({ - hasPrompt: false, - player: ctx.player || "global", - }); + try { + callback({ + hasPrompt: true, + player: ctx.player || "global", + def: ctx.def, + tryAnswer, + }); + return await next(); + } finally { + callback({ + hasPrompt: false, + player: ctx.player || "global", + }); + } }); } selectStatus(callback: (status: ClientStatus) => void) {