1
- /* global _, Vue, moment, LNbits, EventHub, decryptLnurlPayAES */
1
+ window . app . component ( QrcodeVue )
2
2
3
- Vue . component ( 'lnbits-fsat' , {
3
+ window . app . component ( 'lnbits-fsat' , {
4
4
props : {
5
5
amount : {
6
6
type : Number ,
@@ -15,12 +15,13 @@ Vue.component('lnbits-fsat', {
15
15
}
16
16
} )
17
17
18
- Vue . component ( 'lnbits-wallet-list' , {
18
+ window . app . component ( 'lnbits-wallet-list' , {
19
+ props : [ 'balance' ] ,
19
20
data : function ( ) {
20
21
return {
21
22
user : null ,
22
23
activeWallet : null ,
23
- activeBalance : [ ] ,
24
+ balance : 0 ,
24
25
showForm : false ,
25
26
walletName : '' ,
26
27
LNBITS_DENOMINATION : LNBITS_DENOMINATION
@@ -74,7 +75,7 @@ Vue.component('lnbits-wallet-list', {
74
75
` ,
75
76
computed : {
76
77
wallets : function ( ) {
77
- var bal = this . activeBalance
78
+ var bal = this . balance
78
79
return this . user . wallets . map ( function ( obj ) {
79
80
obj . live_fsat =
80
81
bal . length && bal [ 0 ] === obj . id
@@ -87,9 +88,6 @@ Vue.component('lnbits-wallet-list', {
87
88
methods : {
88
89
createWallet : function ( ) {
89
90
LNbits . api . createWallet ( this . user . wallets [ 0 ] , this . walletName )
90
- } ,
91
- updateWalletBalance : function ( payload ) {
92
- this . activeBalance = payload
93
91
}
94
92
} ,
95
93
created : function ( ) {
@@ -99,11 +97,11 @@ Vue.component('lnbits-wallet-list', {
99
97
if ( window . wallet ) {
100
98
this . activeWallet = LNbits . map . wallet ( window . wallet )
101
99
}
102
- EventHub . $on ( 'update-wallet-balance ', this . updateWalletBalance )
100
+ document . addEventListener ( 'updateWalletBalance ', this . updateWalletBalance )
103
101
}
104
102
} )
105
103
106
- Vue . component ( 'lnbits-extension-list' , {
104
+ window . app . component ( 'lnbits-extension-list' , {
107
105
data : function ( ) {
108
106
return {
109
107
extensions : [ ] ,
@@ -169,7 +167,7 @@ Vue.component('lnbits-extension-list', {
169
167
}
170
168
} )
171
169
172
- Vue . component ( 'lnbits-manage' , {
170
+ window . app . component ( 'lnbits-manage' , {
173
171
props : [ 'showAdmin' , 'showNode' , 'showExtensions' , 'showUsers' ] ,
174
172
methods : {
175
173
isActive : function ( path ) {
@@ -229,9 +227,9 @@ Vue.component('lnbits-manage', {
229
227
}
230
228
} )
231
229
232
- Vue . component ( 'lnbits-payment-details' , {
230
+ window . app . component ( 'lnbits-payment-details' , {
233
231
props : [ 'payment' ] ,
234
- mixins : [ windowMixin ] ,
232
+ mixins : [ window . windowMixin ] ,
235
233
data : function ( ) {
236
234
return {
237
235
LNBITS_DENOMINATION : LNBITS_DENOMINATION
@@ -345,7 +343,7 @@ Vue.component('lnbits-payment-details', {
345
343
}
346
344
} )
347
345
348
- Vue . component ( 'lnbits-lnurlpay-success-action' , {
346
+ window . app . component ( 'lnbits-lnurlpay-success-action' , {
349
347
props : [ 'payment' , 'success_action' ] ,
350
348
data ( ) {
351
349
return {
@@ -374,26 +372,27 @@ Vue.component('lnbits-lnurlpay-success-action', {
374
372
}
375
373
} )
376
374
377
- Vue . component ( 'lnbits-qrcode' , {
378
- mixins : [ windowMixin ] ,
375
+ window . app . component ( 'lnbits-qrcode' , {
376
+ mixins : [ window . windowMixin ] ,
377
+ components : {
378
+ QrcodeVue
379
+ } ,
379
380
props : [ 'value' ] ,
380
- components : { [ VueQrcode . name ] : VueQrcode } ,
381
381
data ( ) {
382
382
return {
383
383
logo : LNBITS_QR_LOGO
384
384
}
385
385
} ,
386
386
template : `
387
387
<div class="qrcode__wrapper">
388
- <qrcode :value="value"
389
- :options="{errorCorrectionLevel: 'Q', width: 800}" class="rounded-borders"></qrcode>
388
+ <qrcode-vue :value="value" size="350" class="rounded-borders"></qrcode-vue>
390
389
<img class="qrcode__image" :src="logo" alt="..." />
391
390
</div>
392
391
`
393
392
} )
394
393
395
- Vue . component ( 'lnbits-notifications-btn' , {
396
- mixins : [ windowMixin ] ,
394
+ window . app . component ( 'lnbits-notifications-btn' , {
395
+ mixins : [ window . windowMixin ] ,
397
396
props : [ 'pubkey' ] ,
398
397
data ( ) {
399
398
return {
@@ -605,8 +604,8 @@ Vue.component('lnbits-notifications-btn', {
605
604
}
606
605
} )
607
606
608
- Vue . component ( 'lnbits-dynamic-fields' , {
609
- mixins : [ windowMixin ] ,
607
+ window . app . component ( 'lnbits-dynamic-fields' , {
608
+ mixins : [ window . windowMixin ] ,
610
609
props : [ 'options' , 'value' ] ,
611
610
data ( ) {
612
611
return {
@@ -742,8 +741,8 @@ Vue.component('lnbits-dynamic-fields', {
742
741
}
743
742
} )
744
743
745
- Vue . component ( 'lnbits-update-balance' , {
746
- mixins : [ windowMixin ] ,
744
+ window . app . component ( 'lnbits-update-balance' , {
745
+ mixins : [ window . windowMixin ] ,
747
746
props : [ 'wallet_id' , 'callback' ] ,
748
747
computed : {
749
748
denomination ( ) {
0 commit comments