@@ -6,7 +6,8 @@ window.windowMixin = {
|
||||
toggleSubs: true,
|
||||
mobileSimple: true,
|
||||
walletFlip: true,
|
||||
showAddWalletDialog: {show: false},
|
||||
addWalletDialog: {show: false, walletType: 'lightning'},
|
||||
walletTypes: [{label: 'Lightning Wallet', value: 'lightning'}],
|
||||
isUserAuthorized: false,
|
||||
isSatsDenomination: WINDOW_SETTINGS['LNBITS_DENOMINATION'] == 'sats',
|
||||
allowedThemes: WINDOW_SETTINGS['LNBITS_THEME_OPTIONS'],
|
||||
@@ -46,23 +47,14 @@ window.windowMixin = {
|
||||
path: '/wallets'
|
||||
})
|
||||
},
|
||||
submitAddWallet() {
|
||||
if (
|
||||
this.showAddWalletDialog.name &&
|
||||
this.showAddWalletDialog.name.length > 0
|
||||
) {
|
||||
LNbits.api.createWallet(
|
||||
this.g.user.wallets[0],
|
||||
this.showAddWalletDialog.name
|
||||
)
|
||||
this.showAddWalletDialog = {show: false}
|
||||
} else {
|
||||
this.$q.notify({
|
||||
message: 'Please enter a name for the wallet',
|
||||
color: 'negative'
|
||||
})
|
||||
handleWalletAction(payload) {
|
||||
if (payload.action === 'create-wallet') {
|
||||
this.showAddNewWalletDialog()
|
||||
}
|
||||
},
|
||||
showAddNewWalletDialog() {
|
||||
this.addWalletDialog = {show: true, walletType: 'lightning'}
|
||||
},
|
||||
simpleMobile() {
|
||||
this.$q.localStorage.set('lnbits.mobileSimple', !this.mobileSimple)
|
||||
this.refreshRoute()
|
||||
@@ -326,6 +318,12 @@ window.windowMixin = {
|
||||
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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user