Skip to content

Commit

Permalink
Merge pull request #12016 from gabrielbazan7/feat/readonly-customtoken
Browse files Browse the repository at this point in the history
[FEAT] File import custom token
  • Loading branch information
cmgustavo authored Mar 28, 2022
2 parents 26a9e3e + c79f0d4 commit cfadbec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/providers/profile/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ export class ProfileProvider {
}

private _importFile(str: string, opts): Promise<any> {
return new Promise((resolve, reject) => {
return new Promise(async (resolve, reject) => {
opts = opts ? opts : {};
opts['bp_partner'] = this.appProvider.info.name;
opts['bp_partner_version'] = this.appProvider.info.version;
Expand Down Expand Up @@ -1172,6 +1172,16 @@ export class ProfileProvider {
);
}

// check if custom token
if (!this.coinSupported(credentials.coin) && credentials.token) {
const customTokens = [];
customTokens.push({
...credentials.token,
...{ symbol: credentials.token.symbol.toLowerCase() }
});
await this.currencyProvider.addCustomToken(customTokens);
}

client.fromString(JSON.stringify(credentials));

if (key) {
Expand Down

0 comments on commit cfadbec

Please sign in to comment.