From b753405f697b30adc35fccf6342bebc1413e2c10 Mon Sep 17 00:00:00 2001 From: Ajinkya Rajandekar <145996984+ajinkyaraj-23@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:50:32 +0000 Subject: [PATCH] Update migration after removing the blacklisted keys. --- packages/state/src/migrations.test.ts | 9 --------- packages/state/src/migrations.ts | 8 +++++++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/state/src/migrations.test.ts b/packages/state/src/migrations.test.ts index ba4b28d34c..f5c08a6809 100644 --- a/packages/state/src/migrations.test.ts +++ b/packages/state/src/migrations.test.ts @@ -10,15 +10,6 @@ describe("migrations", () => { expect(mainStoreMigrations[0]({ multisigs: {} })).toEqual({ multisigs: { labelsMap: {} } }); }); - test("1", () => { - expect(mainStoreMigrations[1]({})).toEqual({ - announcement: { - html: "", - seen: true, - }, - }); - }); - test("5", () => { expect( mainStoreMigrations[5]({ diff --git a/packages/state/src/migrations.ts b/packages/state/src/migrations.ts index e563a456db..7bc80fe799 100644 --- a/packages/state/src/migrations.ts +++ b/packages/state/src/migrations.ts @@ -14,7 +14,9 @@ export const mainStoreMigrations = { }), 1: (state: any) => produce(state, (draft: any) => { - draft.announcement = announcementsInitialState; + if (draft.announcement) { + draft.announcement = announcementsInitialState; + } }), 2: identity, 3: (state: any) => @@ -58,6 +60,9 @@ export const mainStoreMigrations = { }, 7: (state: any) => produce(state, (draft: any) => { + if (!draft.assets) { + return; + } draft.assets.accountStates = {}; draft.assets.block = { level: draft.assets.blockLevel }; delete draft.assets["blockLevel"]; @@ -80,6 +85,7 @@ export const mainStoreMigrations = { } } }), + 10: identity, } as any; export const accountsMigrations = {