From 39bd62f1a82c8ccac70896c0649507d87f32f8ac Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 6 May 2024 18:14:09 -0500 Subject: [PATCH] Checkpoint: confusing but working state machine --- src/state/messages/convo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/messages/convo.ts b/src/state/messages/convo.ts index 21fb91424b..e426d3d746 100644 --- a/src/state/messages/convo.ts +++ b/src/state/messages/convo.ts @@ -327,7 +327,6 @@ export class Convo { this.refreshConvo() .then(async () => { - await new Promise(y => setTimeout(y, 2000)) if (this.status === ConvoStatus.Initializing) { this.status = ConvoStatus.Ready this.commit() @@ -363,7 +362,6 @@ export class Convo { } // TODO resume failure - // TODO can I resume from error? resume() { if ( this.status === ConvoStatus.Suspended || @@ -381,6 +379,8 @@ export class Convo { this.refreshConvo().then(() => { this.commit() }) + } else if (this.status === ConvoStatus.Error) { + this.init() } else { logger.debug( `Convo: resume called from ${this.status}`,