Skip to content

Commit

Permalink
fix import ui when offline and recover import afterwards
Browse files Browse the repository at this point in the history
  • Loading branch information
kibibytium committed Jan 9, 2025
1 parent 67d6abf commit 3050313
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mail-app/mail/import/MailImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export class MailImporter {
this.uiStatus === UiImportStatus.Running ||
this.uiStatus === UiImportStatus.Pausing ||
this.uiStatus === UiImportStatus.Paused ||
this.uiStatus === UiImportStatus.Cancelling
this.uiStatus === UiImportStatus.Cancelling ||
this.uiStatus === UiImportStatus.Error
)
}

Expand Down Expand Up @@ -359,7 +360,7 @@ export class MailImporter {
this.uiStatus = importStatusToUiImportStatus(this.activeImport.status)
this.updateProgressMonitorTotalWork(localImportMailState.totalMails)
this.progressMonitor?.totalWorkDone(localImportMailState.successfulMails + localImportMailState.failedMails)
if (localImportMailState.status == ImportStatus.Finished) this.stopProgressEstimation()
if (localImportMailState.status == ImportStatus.Finished || localImportMailState.status === ImportStatus.Error) this.stopProgressEstimation()
}
}
m.redraw()
Expand Down Expand Up @@ -406,9 +407,10 @@ export class MailImporter {
this.wsConnectionOnline = wsConnection === WsConnectionState.connected
if (haveImportOngoing && !this.wsConnectionOnline) {
this.stopProgressEstimation()
this.uiStatus = UiImportStatus.Paused
m.redraw()
await this.setProgressAction(ImportProgressAction.Pause)
} else if (haveImportOngoing && this.wsConnectionOnline) {
await this.setProgressAction(ImportProgressAction.Continue)
this.uiStatus = UiImportStatus.Paused
}
})
}
Expand Down

0 comments on commit 3050313

Please sign in to comment.