@@ -283,43 +283,41 @@ export default defineComponent({
283
283
)
284
284
})
285
285
const rate = computed (() => {
286
- if (! transaction .value ) return
286
+ if (! transaction .value ) return Symbols . HOURGLASS
287
287
288
288
return store .getters [' rate/rate' ](transaction .value .amount , props .crypto )
289
289
})
290
290
291
291
const calculatedTimestampInSec = computed (() => {
292
292
if (! transaction .value ) {
293
- return null ;
293
+ return null
294
294
}
295
295
296
296
return timestampInSec (props .crypto , transaction .value .timestamp ! )
297
297
})
298
298
299
299
const calculatedFee = computed (() => {
300
- const commissionTokenLabel = (props .feeCrypto ?? props .crypto ) as CryptoSymbol ;
300
+ const commissionTokenLabel = (props .feeCrypto ?? props .crypto ) as CryptoSymbol
301
301
302
302
const { cryptoTransferDecimals, decimals } = CryptosInfo [commissionTokenLabel ]
303
303
304
- const tokenFee = typeof props .fee === ' number'
305
- ? ` ${formatAmount (props .fee , cryptoTransferDecimals ?? decimals )} ${commissionTokenLabel } `
306
- : placeholder .value ;
307
-
308
- if (! props .fee || ! calculatedTimestampInSec .value ) return tokenFee ;
304
+ const tokenFee =
305
+ props .queryStatus === ' success' && typeof props .fee === ' number'
306
+ ? ` ${formatAmount (props .fee , cryptoTransferDecimals ?? decimals )} ${commissionTokenLabel } `
307
+ : placeholder .value
309
308
309
+ if (! props .fee || ! calculatedTimestampInSec .value ) return tokenFee
310
310
311
311
const commissionUsdAmount = store .getters [' rate/historyRate' ](
312
312
calculatedTimestampInSec .value ,
313
313
props .fee ,
314
- commissionTokenLabel ,
315
- );
316
-
317
-
318
- if (! commissionUsdAmount ) return tokenFee ;
314
+ commissionTokenLabel
315
+ )
319
316
320
- return tokenFee + ` ~${commissionUsdAmount } ` ;
321
- });
317
+ if (! commissionUsdAmount ) return tokenFee
322
318
319
+ return tokenFee + ` ~${commissionUsdAmount } `
320
+ })
323
321
324
322
const handleCopyToClipboard = (text ? : string ) => {
325
323
if (! text ) return
@@ -365,9 +363,7 @@ export default defineComponent({
365
363
)
366
364
367
365
const formatAmount = (amount : number , decimals = CryptosInfo [props .crypto ].decimals ) => {
368
- return BigNumber (amount )
369
- .decimalPlaces (decimals , BigNumber .ROUND_DOWN )
370
- .toFixed ()
366
+ return BigNumber (amount ).decimalPlaces (decimals , BigNumber .ROUND_DOWN ).toFixed ()
371
367
}
372
368
373
369
return {
0 commit comments