Skip to content

Commit

Permalink
Merge branch 'onekey' into feat/ln-check-balance
Browse files Browse the repository at this point in the history
  • Loading branch information
originalix authored Oct 13, 2023
2 parents e645cd2 + 70843ae commit cd67117
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/engine/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,19 @@ class Engine {
if (typeof accountId !== 'undefined') {
if (withMain) {
if (!tokens.find((t) => t.isNative) && !isAllNetworks(networkId)) {
tokens.unshift(await this.generateNativeTokenByNetworkId(networkId));
const nativeTokensInSimpleDB = await simpleDb.token.getTokens({
networkId,
query: {
isNative: true,
},
});
if (nativeTokensInSimpleDB?.length > 0) {
tokens.unshift(nativeTokensInSimpleDB[0]);
} else {
tokens.unshift(
await this.generateNativeTokenByNetworkId(networkId),
);
}
}
return tokens;
}
Expand Down

0 comments on commit cd67117

Please sign in to comment.