Skip to content

Commit

Permalink
fix opensea/autodetect setting dependency relation (#13575)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 authored Feb 10, 2022
1 parent 7148607 commit 7223d4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions app/scripts/controllers/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
Expand Down

0 comments on commit 7223d4c

Please sign in to comment.