@@ -35,7 +35,7 @@ import {
3535} from ' @/common/types' ;
3636import EnvironmentContextProviderService from ' @/common/providers/EnvironmentContextProvider' ;
3737import * as constants from ' @/common/store/constants' ;
38- import { getTime , setStatusMessage } from ' @/common/utils' ;
38+ import { getTime , setStatusMessage , toSatoshiBigIntString } from ' @/common/utils' ;
3939import { useAction , useGetter , useStateAttribute } from ' @/common/store/helper' ;
4040import StatusProgressBar from ' @/common/components/status/StatusProgressBar.vue' ;
4141import { EnvironmentAccessorService } from ' @/common/services/enviroment-accessor.service' ;
@@ -57,9 +57,9 @@ export default defineComponent({
5757 setup(props , context ) {
5858 const currentFee = ref (new SatoshiBig (' 0' , ' btc' ));
5959 const currentRefundAddress = ref (' ' );
60- const btcConfirmationsRequired = ref (0 );
60+ const btcConfirmationsRequired = ref (' 0 ' );
6161 const btcConfirmationsPercentage = ref (0 );
62- const btcConfirmations = ref (0 );
62+ const btcConfirmations = ref (' 0 ' );
6363 const rskConfirmationsPercentage = ref (0 );
6464 const leftBtcTime = ref (' ' );
6565
@@ -133,11 +133,13 @@ export default defineComponent({
133133
134134 const flyoverPeginSummary = computed ((): NormalizedSummary => {
135135 const status = txDetails .value as FlyoverStatusModel ;
136- const total = new SatoshiBig (status .amount , ' satoshi' )
137- .plus (new SatoshiBig (status .fee , ' satoshi' ));
136+ const amount = toSatoshiBigIntString (status .amount );
137+ const fee = toSatoshiBigIntString (status .fee );
138+ const total = new SatoshiBig (amount , ' satoshi' )
139+ .plus (new SatoshiBig (fee , ' satoshi' ));
138140 return {
139- amountFromString: new SatoshiBig ( status .amount , ' satoshi ' ). toBTCTrimmedString () ,
140- amountReceivedString: new SatoshiBig ( status .amount , ' satoshi ' ). toBTCTrimmedString () ,
141+ amountFromString: status .amount ,
142+ amountReceivedString: status .amount ,
141143 total: total .toBTCTrimmedString (),
142144 fee: status .fee ,
143145 recipientAddress: status .recipientAddress ,
@@ -153,16 +155,22 @@ export default defineComponent({
153155 const showConfirmations = computed (() => ! props .isFlyover
154156 && txDetails .value .status === PegStatus .WAITING_CONFIRMATIONS );
155157
158+ const btcConfirmationsRequiredNumber = computed (() => Number (btcConfirmationsRequired .value ));
159+
160+ const btcConfirmationsNumber = computed (() => Number (btcConfirmations .value ));
161+
156162 function refreshPercentage() {
157163 if (' btc' in txDetails .value ) {
158164 const { btc } = txDetails .value ;
159- btcConfirmationsRequired .value = btc .requiredConfirmation ;
160- btcConfirmations .value = btc .confirmations ?? 0 ;
165+ btcConfirmationsRequired .value = btc .requiredConfirmation . toString () ;
166+ btcConfirmations .value = btc .confirmations . toString () ?? ' 0 ' ;
161167 btcConfirmations .value = btcConfirmations .value > btcConfirmationsRequired .value
162168 ? btcConfirmationsRequired .value : btcConfirmations .value ;
163- leftBtcTime .value = getTime ((btcConfirmationsRequired .value - btcConfirmations .value ) * 10 );
169+ leftBtcTime .value = getTime (
170+ (btcConfirmationsRequiredNumber .value - btcConfirmationsNumber .value ) * 10 ,
171+ );
164172 btcConfirmationsPercentage .value = btcConfirmations .value <= btcConfirmationsRequired .value
165- ? (btcConfirmations .value * 100 ) / btcConfirmationsRequired .value : 100 ;
173+ ? (btcConfirmationsNumber .value * 100 ) / btcConfirmationsRequiredNumber .value : 100 ;
166174 if (txDetails .value .status === constants .PegStatus .CONFIRMED ) {
167175 rskConfirmationsPercentage .value = 100 ;
168176 } else {
0 commit comments