Skip to content

Commit

Permalink
Merge pull request #11971 from Gamboster/fix/tokenAndCoinsOptsOrder
Browse files Browse the repository at this point in the history
Fix: coin and token opts order
  • Loading branch information
cmgustavo authored Nov 29, 2021
2 parents d11a820 + e612894 commit 8900c6c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/providers/currency/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,20 @@ export class CurrencyProvider {
.getCustomTokenOpts()
.then(customERC20Opts => {
this.customERC20Opts = customERC20Opts;
this.coinOpts = { ...this.customERC20CoinsData, ...availableCoins };
const tokenOpts = { ...this.customERC20Opts, ...TokenOpts };

// Workaround to keep the initial order of the tokens and replace any custom tokens that have failed during creation in the past
// TODO: review amount.ts how the alternative amounts works, and make a refactor if necessary
this.coinOpts = {
...availableCoins,
...this.customERC20CoinsData,
...availableCoins
};
const tokenOpts = {
...TokenOpts,
...this.customERC20Opts,
...TokenOpts
};

this.availableTokens = Object.values(tokenOpts);
this.availableCoins = Object.keys(this.coinOpts) as string[];
this.retreiveInfo();
Expand Down

0 comments on commit 8900c6c

Please sign in to comment.