fix: mapping of user was done each time component was initialised (#3573)

This commit is contained in:
dni ⚡
2025-11-26 13:21:36 +01:00
committed by GitHub
parent baa9a35773
commit 21505471d5
6 changed files with 19 additions and 40 deletions
+4 -17
View File
@@ -1,12 +1,4 @@
window.windowMixin = {
i18n: window.i18n,
data() {
return {
g: window.g,
utils: window._lnbitsUtils,
...WINDOW_SETTINGS
}
},
methods: {
openNewWalletDialog(walletType = 'lightning') {
this.g.newWalletType = walletType
@@ -115,16 +107,11 @@ window.windowMixin = {
})
}
},
async created() {
if (window.user) {
this.g.user = Vue.reactive(window.LNbits.map.user(window.user))
created() {
// map jinja variable once on pageload
if (window.user && !this.g.user) {
this.g.user = window.LNbits.map.user(window.user)
this.paymentEvents()
}
if (window.wallet) {
this.g.wallet = Vue.reactive(window.LNbits.map.wallet(window.wallet))
}
if (window.extensions) {
this.g.extensions = Vue.reactive(window.extensions)
}
}
}