feat: Shared Wallets/Joint Accounts (Issue #3297) (#3376)

This commit is contained in:
Ben Weeks
2025-11-07 22:25:03 +02:00
committed by GitHub
parent bd07f7a5ef
commit b54eedee84
31 changed files with 2078 additions and 163 deletions
+14 -16
View File
@@ -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))
}