From 0862b5dfe3391dce5555b6ba85f95708acf9b775 Mon Sep 17 00:00:00 2001 From: Cal Leung Date: Mon, 4 Oct 2021 20:05:40 -0700 Subject: [PATCH 1/3] Update migration to turn off token detection --- app/core/Engine.js | 5 +++-- app/store/migrations.js | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/core/Engine.js b/app/core/Engine.js index 935ee53fcf8..5eda3383cd3 100644 --- a/app/core/Engine.js +++ b/app/core/Engine.js @@ -66,8 +66,9 @@ class Engine { { ipfsGateway: AppConstants.IPFS_DEFAULT_GATEWAY_URL, useStaticTokenList: - (initialState.PreferencesController && initialState.PreferencesController.useStaticTokenList) || - true, + initialState?.PreferencesController?.useStaticTokenList === undefined + ? true + : initialState.PreferencesController.useStaticTokenList, } ); const networkController = new NetworkController({ diff --git a/app/store/migrations.js b/app/store/migrations.js index d261703a7bc..889089cdc98 100644 --- a/app/store/migrations.js +++ b/app/store/migrations.js @@ -240,6 +240,13 @@ export const migrations = { return state; }, + 9: (state) => { + state.engine.backgroundState.PreferencesController = { + ...state.engine.backgroundState.PreferencesController, + useStaticTokenList: true, + }; + return state; + }, }; -export const version = 8; +export const version = 9; From 285ca57f180b22af1bd5153fe341d73a9aa810f7 Mon Sep 17 00:00:00 2001 From: Cal Leung Date: Tue, 5 Oct 2021 09:21:35 -0700 Subject: [PATCH 2/3] Simplify logic Co-authored-by: Gustavo Antunes --- app/core/Engine.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/core/Engine.js b/app/core/Engine.js index 5eda3383cd3..803f78156a6 100644 --- a/app/core/Engine.js +++ b/app/core/Engine.js @@ -66,9 +66,8 @@ class Engine { { ipfsGateway: AppConstants.IPFS_DEFAULT_GATEWAY_URL, useStaticTokenList: - initialState?.PreferencesController?.useStaticTokenList === undefined - ? true - : initialState.PreferencesController.useStaticTokenList, +initialState?.PreferencesController?.useStaticTokenList === undefined || +initialState.PreferencesController.useStaticTokenList, } ); const networkController = new NetworkController({ From 2d7e45a857b8d52c0c18d72b4959a743fbb18e8f Mon Sep 17 00:00:00 2001 From: Cal Leung Date: Tue, 5 Oct 2021 11:33:46 -0700 Subject: [PATCH 3/3] Fix test --- app/core/Engine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/core/Engine.js b/app/core/Engine.js index 803f78156a6..216849aa5a0 100644 --- a/app/core/Engine.js +++ b/app/core/Engine.js @@ -66,8 +66,8 @@ class Engine { { ipfsGateway: AppConstants.IPFS_DEFAULT_GATEWAY_URL, useStaticTokenList: -initialState?.PreferencesController?.useStaticTokenList === undefined || -initialState.PreferencesController.useStaticTokenList, + initialState?.PreferencesController?.useStaticTokenList === undefined || + initialState.PreferencesController.useStaticTokenList, } ); const networkController = new NetworkController({