File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1065,6 +1065,9 @@ <h6 class="text-subtitle1 q-my-none">
1065
1065
itemFormatPrice ( price , id ) {
1066
1066
const tpos = id . split ( ':' ) [ 0 ]
1067
1067
const currency = _ . findWhere ( this . tposs , { id : tpos } ) . currency
1068
+ if ( currency == 'sats' ) {
1069
+ return price + ' sats'
1070
+ }
1068
1071
return LNbits . utils . formatCurrency ( Number ( price ) . toFixed ( 2 ) , currency )
1069
1072
} ,
1070
1073
openItemDialog ( id ) {
Original file line number Diff line number Diff line change @@ -773,6 +773,7 @@ <h5 class="q-mt-none q-mb-sm">
773
773
computed : {
774
774
amount : function ( ) {
775
775
if ( ! this . stack . length ) return 0.0
776
+ if ( this . currency == 'sats' ) return Number ( this . stack . join ( "" ) )
776
777
return (
777
778
this . stack . reduce ( ( acc , dig ) => acc * 10 + dig , 0 ) *
778
779
( this . currency == 'sats' ? 1 : 0.01 )
@@ -1246,11 +1247,13 @@ <h5 class="q-mt-none q-mb-sm">
1246
1247
getRates ( ) {
1247
1248
if ( this . currency == 'sats' ) {
1248
1249
this . exchangeRate = 1
1250
+ this . $q . loading . hide ( )
1249
1251
} else {
1250
1252
LNbits . api
1251
1253
. request ( 'GET' , `/tpos/api/v1/rate/${ this . currency } ` )
1252
1254
. then ( response => {
1253
1255
this . exchangeRate = response . data . rate
1256
+ this . $q . loading . hide ( )
1254
1257
} )
1255
1258
. catch ( e => console . error ( e ) )
1256
1259
}
@@ -1321,9 +1324,9 @@ <h5 class="q-mt-none q-mb-sm">
1321
1324
}
1322
1325
}
1323
1326
} ,
1324
- created : function ( ) {
1325
- var getRates = this . getRates
1326
- getRates ( )
1327
+ created ( ) {
1328
+ this . $q . loading . show ( )
1329
+ this . getRates ( )
1327
1330
this . pinDisabled = JSON . parse ( '{{ tpos.withdrawpindisabled | tojson }}' )
1328
1331
this . tip_options =
1329
1332
'{{ tpos.tip_options | tojson }}' == 'null'
@@ -1388,8 +1391,8 @@ <h5 class="q-mt-none q-mb-sm">
1388
1391
event . preventDefault ( )
1389
1392
} )
1390
1393
1391
- setInterval ( function ( ) {
1392
- getRates ( )
1394
+ setInterval ( ( ) => {
1395
+ this . getRates ( )
1393
1396
} , 120000 )
1394
1397
}
1395
1398
} )
You can’t perform that action at this time.
0 commit comments