File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
javascript/engine-js/src/view Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- import { ITransactionListener , ITransactionStatus } from "../ITokenScript" ;
1
+ import { ITransactionListener , ITransactionStatus , TokenMetadataMap } from "../ITokenScript" ;
2
2
import { TokenScript } from "../TokenScript" ;
3
3
import { Card } from "../tokenScript/Card" ;
4
4
import { RpcRequest , RpcResponse } from "../wallet/IWalletAdapter" ;
@@ -136,7 +136,7 @@ export class ViewController {
136
136
137
137
if ( txOptions . triggers ?. length ) {
138
138
139
- let tokens ;
139
+ let tokens : TokenMetadataMap ;
140
140
if ( txOptions . triggers . indexOf ( "refreshTokens" ) > - 1 ) {
141
141
// Pause to let token discovery service update
142
142
await new Promise ( resolve => setTimeout ( resolve , 3000 ) ) ;
@@ -151,7 +151,15 @@ export class ViewController {
151
151
// The card is reloaded based on the following criteria
152
152
// - The card is still available based on isEnabledOrReason
153
153
// - Tokens have not been reloaded OR the card is an onboarding card OR the token still exists (not burnt or transferred)
154
- if ( reloadCard && ( ! context || ! tokens || tokens [ context . originId ] ?. tokenDetails ?. [ context . selectedTokenIndex ] ) ) {
154
+ if (
155
+ reloadCard &&
156
+ (
157
+ ! context ||
158
+ ! tokens ||
159
+ tokens [ context . originId ] ?. tokenType === "erc20" ||
160
+ tokens [ context . originId ] ?. tokenDetails ?. [ context . selectedTokenIndex ]
161
+ )
162
+ ) {
155
163
await this . updateCardData ( ) ;
156
164
} else {
157
165
await this . unloadTokenCard ( ) ;
You can’t perform that action at this time.
0 commit comments