Skip to content

Commit

Permalink
Do not add maxMilliseconds if 0 or undefined (#102)
Browse files Browse the repository at this point in the history
* Do not add maxMilliseconds if 0 or undefined

* deno fmt
  • Loading branch information
KnightNiwrem authored Apr 15, 2024
1 parent e4045f2 commit 9725eca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,9 @@ export class ConversationHandle<C extends Context> {
opts?: OtherwiseConfig<C>,
): Promise<C> {
const { otherwise, drop, maxMilliseconds } = toObj(opts);
const ctx = await this.wait({ maxMilliseconds });
const ctx = maxMilliseconds
? await this.wait({ maxMilliseconds })
: await this.wait();
if (!await predicate(ctx)) {
await otherwise?.(ctx);
await this.skip({ drop });
Expand Down

0 comments on commit 9725eca

Please sign in to comment.