chore: refactor windowMixin, init-app.js, lnbits-theme (#3569)

This commit is contained in:
dni ⚡
2025-11-25 14:31:17 +01:00
committed by GitHub
parent 0910687328
commit 7a796c6510
8 changed files with 30 additions and 36 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -1,6 +1,12 @@
window.app.component('lnbits-theme', {
mixins: [window.windowMixin],
watch: {
'g.walletFlip'(val) {
this.$q.localStorage.setItem('lnbits.walletFlip', val)
if (val === true && this.$q.screen.lt.md) {
this.g.visibleDrawer = false
}
},
'g.disclaimerShown'(val) {
this.$q.localStorage.setItem('lnbits.disclaimerShown', val)
},
+15 -15
View File
@@ -1,3 +1,11 @@
const quasarConfig = {
config: {
loading: {
spinner: Quasar.QSpinnerBars
}
}
}
const routes = [
{
path: '/node',
@@ -71,6 +79,12 @@ window.router = VueRouter.createRouter({
routes
})
window.i18n = new VueI18n.createI18n({
locale: window.g.locale,
fallbackLocale: 'en',
messages: window.localisation
})
window.app.mixin({
computed: {
isVueRoute() {
@@ -83,22 +97,8 @@ window.app.mixin({
})
window.app.use(VueQrcodeReader)
window.app.use(Quasar, {
config: {
loading: {
spinner: Quasar.QSpinnerBars
}
}
})
window.i18n = new VueI18n.createI18n({
locale: window.g.locale,
fallbackLocale: 'en',
messages: window.localisation
})
window.app.use(Quasar, quasarConfig)
window.app.use(window.i18n)
window.app.provide('g', g)
window.app.use(window.router)
window.app.mount('#vue')
-15
View File
@@ -2,10 +2,7 @@ window.windowMixin = {
i18n: window.i18n,
data() {
return {
api: window._lnbitsApi,
utils: window._lnbitsUtils,
g: window.g,
currencies: window.currencies,
...WINDOW_SETTINGS
}
},
@@ -14,18 +11,6 @@ window.windowMixin = {
this.g.newWalletType = walletType
this.g.showNewWalletDialog = true
},
flipWallets(smallScreen) {
this.g.walletFlip = !this.g.walletFlip
if (this.g.walletFlip && smallScreen) {
this.g.visibleDrawer = false
}
this.$q.localStorage.set('lnbits.walletFlip', this.g.walletFlip)
},
goToWallets() {
this.$router.push({
path: '/wallets'
})
},
paymentEvents() {
this.g.walletEventListeners = this.g.walletEventListeners || []
this.g.user.wallets.forEach(wallet => {