Keep bulk migration open when aborting during execution

This commit is contained in:
schroda
2026-05-13 01:36:33 +02:00
parent 06cc0724df
commit 0bd5896cee
6 changed files with 40 additions and 6 deletions

View File

@@ -209,8 +209,9 @@ export class MigrationManager {
);
case MigrationPhase.MIGRATING:
return (
MigrationManager.getState().isAborted ||
MigrationManager.getState().migrationProgress.completed ===
MigrationManager.getState().migrationProgress.total
MigrationManager.getState().migrationProgress.total
);
default:
return false;
@@ -470,13 +471,27 @@ export class MigrationManager {
}
}
static async abort(reason: unknown = 'abort'): Promise<boolean> {
static async stop(reason: unknown = 'stopped'): Promise<boolean> {
if (!(await MigrationManager.confirmAbort())) {
return false;
}
MigrationManager.abortAndResetAbortController(reason);
MigrationManager.updateState((draft) => {
draft.isAborted = true;
});
return true;
}
static async abort(reason: unknown = 'abort'): Promise<boolean> {
if (!MigrationManager.getState().isAborted && !(await MigrationManager.confirmAbort())) {
return false;
}
MigrationManager.abortAndResetAbortController(reason);
MigrationManager.reset();
ReactRouter.navigate(AppRoutes.browse.path(BrowseTab.MIGRATE));