refactor: move walletTypes from mixin into lnbits-new-user-wallet (#3519)
This commit is contained in:
parent
00eaec8290
commit
f1fc4710ee
5 changed files with 21 additions and 20 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -4,6 +4,7 @@ window.app.component('lnbits-new-user-wallet', {
|
|||
mixins: [window.windowMixin],
|
||||
data() {
|
||||
return {
|
||||
walletTypes: [{label: 'Lightning Wallet', value: 'lightning'}],
|
||||
newWallet: {walletType: 'lightning', name: '', sharedWalletId: ''}
|
||||
}
|
||||
},
|
||||
|
|
@ -70,5 +71,13 @@ window.app.component('lnbits-new-user-wallet', {
|
|||
LNbits.utils.notifyApiError(e)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.g.user?.extra?.wallet_invite_requests?.length) {
|
||||
this.walletTypes.push({
|
||||
label: `Lightning Wallet (Share Invite: ${this.g.user.extra.wallet_invite_requests.length})`,
|
||||
value: 'lightning-shared'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -50,3 +50,13 @@ const websocketPrefix =
|
|||
const websocketUrl = `${websocketPrefix}${window.location.host}/api/v1/ws`
|
||||
|
||||
const _access_cookies_for_safari_refresh_do_not_delete = document.cookie
|
||||
|
||||
addEventListener('offline', event => {
|
||||
console.log('offline', event)
|
||||
this.g.offline = true
|
||||
})
|
||||
|
||||
addEventListener('online', event => {
|
||||
console.log('back online', event)
|
||||
this.g.offline = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ window.windowMixin = {
|
|||
g: window.g,
|
||||
toggleSubs: true,
|
||||
addWalletDialog: {show: false, walletType: 'lightning'},
|
||||
walletTypes: [{label: 'Lightning Wallet', value: 'lightning'}],
|
||||
isSatsDenomination: WINDOW_SETTINGS['LNBITS_DENOMINATION'] == 'sats',
|
||||
allowedThemes: WINDOW_SETTINGS['LNBITS_THEME_OPTIONS'],
|
||||
walletEventListeners: [],
|
||||
|
|
@ -125,26 +124,9 @@ window.windowMixin = {
|
|||
}
|
||||
},
|
||||
async created() {
|
||||
addEventListener('offline', event => {
|
||||
console.log('offline', event)
|
||||
this.g.offline = true
|
||||
})
|
||||
|
||||
addEventListener('online', event => {
|
||||
console.log('back online', event)
|
||||
this.g.offline = false
|
||||
})
|
||||
|
||||
if (window.user) {
|
||||
this.g.user = Vue.reactive(window.LNbits.map.user(window.user))
|
||||
}
|
||||
|
||||
if (this.g.user?.extra?.wallet_invite_requests?.length) {
|
||||
this.walletTypes.push({
|
||||
label: `Lightning Wallet (Share Invite: ${this.g.user.extra.wallet_invite_requests.length})`,
|
||||
value: 'lightning-shared'
|
||||
})
|
||||
}
|
||||
if (window.wallet) {
|
||||
this.g.wallet = Vue.reactive(window.LNbits.map.wallet(window.wallet))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue