From 760ffbd90fe360c2c9caed5f9e67873994e1770f Mon Sep 17 00:00:00 2001 From: Owen Craston Date: Tue, 7 Jan 2025 17:51:22 -0500 Subject: [PATCH] simplify validate migration function --- app/store/validateMigration/validateMigration.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/store/validateMigration/validateMigration.ts b/app/store/validateMigration/validateMigration.ts index 21d6cae5db2..0638d65b680 100644 --- a/app/store/validateMigration/validateMigration.ts +++ b/app/store/validateMigration/validateMigration.ts @@ -18,14 +18,7 @@ const checks: ValidationCheck[] = [ * This makes sure your app keeps running even if some data is unexpected. */ export function validatePostMigrationState(state: RootState): void { - const allErrors: string[] = []; - - for (const check of checks) { - const errors = check(state); - if (errors.length > 0) { - allErrors.push(...errors); - } - } + const allErrors = checks.flatMap((check) => check(state)); // If there are any errors, log them if (allErrors.length > 0) {