Checkpoint: confusing but working state machine
This commit is contained in:
@@ -327,7 +327,6 @@ export class Convo {
|
|||||||
|
|
||||||
this.refreshConvo()
|
this.refreshConvo()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await new Promise(y => setTimeout(y, 2000))
|
|
||||||
if (this.status === ConvoStatus.Initializing) {
|
if (this.status === ConvoStatus.Initializing) {
|
||||||
this.status = ConvoStatus.Ready
|
this.status = ConvoStatus.Ready
|
||||||
this.commit()
|
this.commit()
|
||||||
@@ -363,7 +362,6 @@ export class Convo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO resume failure
|
// TODO resume failure
|
||||||
// TODO can I resume from error?
|
|
||||||
resume() {
|
resume() {
|
||||||
if (
|
if (
|
||||||
this.status === ConvoStatus.Suspended ||
|
this.status === ConvoStatus.Suspended ||
|
||||||
@@ -381,6 +379,8 @@ export class Convo {
|
|||||||
this.refreshConvo().then(() => {
|
this.refreshConvo().then(() => {
|
||||||
this.commit()
|
this.commit()
|
||||||
})
|
})
|
||||||
|
} else if (this.status === ConvoStatus.Error) {
|
||||||
|
this.init()
|
||||||
} else {
|
} else {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Convo: resume called from ${this.status}`,
|
`Convo: resume called from ${this.status}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user