Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Jun 13, 2022
1 parent 70792c4 commit e274d42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
36 changes: 19 additions & 17 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,25 +247,27 @@ export default class MetamaskController extends EventEmitter {
state: initState.TokensController,
});

this.assetsContractController = new AssetsContractController({
onPreferencesStateChange: (listener) =>
this.preferencesController.store.subscribe(listener),
onNetworkStateChange: (cb) =>
this.networkController.store.subscribe((networkState) => {
const modifiedNetworkState = {
...networkState,
provider: {
...networkState.provider,
chainId: hexToDecimal(networkState.provider.chainId),
},
};
return cb(modifiedNetworkState);
}),
config: {
this.assetsContractController = new AssetsContractController(
{
onPreferencesStateChange: (listener) =>
this.preferencesController.store.subscribe(listener),
onNetworkStateChange: (cb) =>
this.networkController.store.subscribe((networkState) => {
const modifiedNetworkState = {
...networkState,
provider: {
...networkState.provider,
chainId: hexToDecimal(networkState.provider.chainId),
},
};
return cb(modifiedNetworkState);
}),
},
{
provider: this.provider,
},
state: initState.AssetsContractController,
});
initState.AssetsContractController,
);

this.collectiblesController = new CollectiblesController(
{
Expand Down
7 changes: 0 additions & 7 deletions ui/pages/import-token/token-list/token-list.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ export default class TokenList extends Component {
.map((_, i) => {
const { iconUrl, symbol, name, address } = results[i] || {};
let iconPath = iconUrl;
if (!process.env.TOKEN_DETECTION_V2) {
/** TODO: Remove during TOKEN_DETECTION_V2 feature flag clean up */
// token from dynamic api list is fetched when useTokenDetection is true
iconPath = useTokenDetection
? iconUrl
: `images/contract/${iconUrl}`;
}
const tokenAlreadyAdded = checkExistingAddresses(address, tokens);
const onClick = () =>
!tokenAlreadyAdded && onToggleToken(results[i]);
Expand Down

0 comments on commit e274d42

Please sign in to comment.