From 7223d4cd2c55abcd94b69b7506fa74ccbfef84af Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Thu, 10 Feb 2022 14:02:06 -0600 Subject: [PATCH] fix opensea/autodetect setting dependency relation (#13575) --- app/scripts/controllers/preferences.js | 11 +++++------ .../experimental-tab/experimental-tab.component.js | 7 ++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index f63a883b6..4a503e7e6 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -143,13 +143,12 @@ export default class PreferencesController { /** * Setter for the `openSeaEnabled` property * - * @param {boolean} val - Whether or not the user prefers to use the OpenSea API for collectibles data. + * @param {boolean} openSeaEnabled - Whether or not the user prefers to use the OpenSea API for collectibles data. */ - setOpenSeaEnabled(val) { - this.store.updateState({ openSeaEnabled: val }); - if (!val) { - this.store.updateState({ useCollectibleDetection: false }); - } + setOpenSeaEnabled(openSeaEnabled) { + this.store.updateState({ + openSeaEnabled, + }); } /** diff --git a/ui/pages/settings/experimental-tab/experimental-tab.component.js b/ui/pages/settings/experimental-tab/experimental-tab.component.js index 1312af5cd..3d2b16fde 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.component.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.component.js @@ -133,10 +133,11 @@ export default class ExperimentalTab extends PureComponent { name: 'Enabled/Disable OpenSea', }, }); - setOpenSeaEnabled(!value); - if (value && !useCollectibleDetection) { - setUseCollectibleDetection(true); + // value is positive when being toggled off + if (value && useCollectibleDetection) { + setUseCollectibleDetection(false); } + setOpenSeaEnabled(!value); }} offLabel={t('off')} onLabel={t('on')}