fix opensea/autodetect setting dependency relation (#13575)

feature/default_network_editable
Alex Donesky 3 years ago committed by GitHub
parent 7148607906
commit 7223d4cd2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      app/scripts/controllers/preferences.js
  2. 7
      ui/pages/settings/experimental-tab/experimental-tab.component.js

@ -143,13 +143,12 @@ export default class PreferencesController {
/** /**
* Setter for the `openSeaEnabled` property * 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) { setOpenSeaEnabled(openSeaEnabled) {
this.store.updateState({ openSeaEnabled: val }); this.store.updateState({
if (!val) { openSeaEnabled,
this.store.updateState({ useCollectibleDetection: false }); });
}
} }
/** /**

@ -133,10 +133,11 @@ export default class ExperimentalTab extends PureComponent {
name: 'Enabled/Disable OpenSea', name: 'Enabled/Disable OpenSea',
}, },
}); });
setOpenSeaEnabled(!value); // value is positive when being toggled off
if (value && !useCollectibleDetection) { if (value && useCollectibleDetection) {
setUseCollectibleDetection(true); setUseCollectibleDetection(false);
} }
setOpenSeaEnabled(!value);
}} }}
offLabel={t('off')} offLabel={t('off')}
onLabel={t('on')} onLabel={t('on')}

Loading…
Cancel
Save