@@ -36,7 +36,7 @@ import {
3636} from ' @/common/types' ;
3737import EnvironmentContextProviderService from ' @/common/providers/EnvironmentContextProvider' ;
3838import * as constants from ' @/common/store/constants' ;
39- import { getTime , setStatusMessage } from ' @/common/utils' ;
39+ import { getTime , setStatusMessage , toSatoshiBigIntString } from ' @/common/utils' ;
4040import {
4141 useAction , useGetter , useStateAttribute ,
4242} from ' @/common/store/helper' ;
@@ -60,9 +60,9 @@ export default defineComponent({
6060 setup(props , context ) {
6161 const currentFee = ref (new SatoshiBig (' 0' , ' btc' ));
6262 const currentRefundAddress = ref (' ' );
63- const btcConfirmationsRequired = ref (0 );
63+ const btcConfirmationsRequired = ref (' 0 ' );
6464 const btcConfirmationsPercentage = ref (0 );
65- const btcConfirmations = ref (0 );
65+ const btcConfirmations = ref (' 0 ' );
6666 const rskConfirmationsPercentage = ref (0 );
6767 const leftBtcTime = ref (' ' );
6868
@@ -137,11 +137,13 @@ export default defineComponent({
137137
138138 const flyoverPeginSummary = computed ((): NormalizedSummary => {
139139 const status = txDetails .value as FlyoverStatusModel ;
140- const total = new SatoshiBig (status .amount , ' satoshi' )
141- .plus (new SatoshiBig (status .fee , ' satoshi' ));
140+ const amount = toSatoshiBigIntString (status .amount );
141+ const fee = toSatoshiBigIntString (status .fee );
142+ const total = new SatoshiBig (amount , ' satoshi' )
143+ .plus (new SatoshiBig (fee , ' satoshi' ));
142144 return {
143- amountFromString: new SatoshiBig ( status .amount , ' satoshi ' ). toBTCTrimmedString () ,
144- amountReceivedString: new SatoshiBig ( status .amount , ' satoshi ' ). toBTCTrimmedString () ,
145+ amountFromString: status .amount ,
146+ amountReceivedString: status .amount ,
145147 total: total .toBTCTrimmedString (),
146148 fee: status .fee ,
147149 recipientAddress: status .recipientAddress ,
@@ -158,16 +160,22 @@ export default defineComponent({
158160 const showConfirmations = computed (() => ! props .isFlyover
159161 && txDetails .value .status === PegStatus .WAITING_CONFIRMATIONS );
160162
163+ const btcConfirmationsRequiredNumber = computed (() => Number (btcConfirmationsRequired .value ));
164+
165+ const btcConfirmationsNumber = computed (() => Number (btcConfirmations .value ));
166+
161167 function refreshPercentage() {
162168 if (' btc' in txDetails .value ) {
163169 const { btc } = txDetails .value ;
164- btcConfirmationsRequired .value = btc .requiredConfirmation ;
165- btcConfirmations .value = btc .confirmations ?? 0 ;
170+ btcConfirmationsRequired .value = btc .requiredConfirmation . toString () ;
171+ btcConfirmations .value = btc .confirmations . toString () ?? ' 0 ' ;
166172 btcConfirmations .value = btcConfirmations .value > btcConfirmationsRequired .value
167173 ? btcConfirmationsRequired .value : btcConfirmations .value ;
168- leftBtcTime .value = getTime ((btcConfirmationsRequired .value - btcConfirmations .value ) * 10 );
174+ leftBtcTime .value = getTime (
175+ (btcConfirmationsRequiredNumber .value - btcConfirmationsNumber .value ) * 10 ,
176+ );
169177 btcConfirmationsPercentage .value = btcConfirmations .value <= btcConfirmationsRequired .value
170- ? (btcConfirmations .value * 100 ) / btcConfirmationsRequired .value : 100 ;
178+ ? (btcConfirmationsNumber .value * 100 ) / btcConfirmationsRequiredNumber .value : 100 ;
171179 if (txDetails .value .status === constants .PegStatus .CONFIRMED ) {
172180 rskConfirmationsPercentage .value = 100 ;
173181 } else {
0 commit comments