Fix updating migration search progress on manual match selection

The "success" and "completed" count could become larger than the "total" count when manually selecting a match for a successful search with no automatically selected match (e.g. when all matches are outdated)
This commit is contained in:
schroda
2026-05-22 12:12:00 +02:00
parent af846e3336
commit 3a976f8e13
2 changed files with 12 additions and 18 deletions

View File

@@ -10,6 +10,10 @@ import type { MigratableEntry, TMigrationEntry } from '@/features/migration/Migr
import { MigrationEntryStatus } from '@/features/migration/Migration.types.ts';
export class MigrationEntries {
public static isSearching(entry: TMigrationEntry): boolean {
return [MigrationEntryStatus.PENDING, MigrationEntryStatus.SEARCHING].includes(entry.status);
}
public static getExcluded(entries: TMigrationEntry[]): TMigrationEntry[] {
return entries.filter((entry) => entry.isExcluded);
}