diff --git a/lnbits/core/static/js/wallet.js b/lnbits/core/static/js/wallet.js index 054cb77e5..51b4d476c 100644 --- a/lnbits/core/static/js/wallet.js +++ b/lnbits/core/static/js/wallet.js @@ -145,7 +145,7 @@ new Vue({ if (this.payments.length) { return _.pluck(this.payments, 'amount').reduce(function (a, b) { return a + b; }, 0) / 1000; } - return this.w.wallet.sat; + return this.g.wallet.sat; }, fbalance: function () { return LNbits.utils.formatSat(this.balance) @@ -211,7 +211,7 @@ new Vue({ createInvoice: function () { var self = this; this.receive.status = 'loading'; - LNbits.api.createInvoice(this.w.wallet, this.receive.data.amount, this.receive.data.memo) + LNbits.api.createInvoice(this.g.wallet, this.receive.data.amount, this.receive.data.memo) .then(function (response) { self.receive.status = 'success'; self.receive.paymentReq = response.data.payment_request; @@ -279,7 +279,7 @@ new Vue({ icon: null }); - LNbits.api.payInvoice(this.w.wallet, this.send.data.bolt11).then(function (response) { + LNbits.api.payInvoice(this.g.wallet, this.send.data.bolt11).then(function (response) { self.send.paymentChecker = setInterval(function () { LNbits.api.getPayment(self.w.wallet, response.data.checking_id).then(function (res) { if (res.data.paid) { @@ -301,7 +301,7 @@ new Vue({ fetchPayments: function (checkPending) { var self = this; - return LNbits.api.getPayments(this.w.wallet, checkPending).then(function (response) { + return LNbits.api.getPayments(this.g.wallet, checkPending).then(function (response) { self.payments = response.data.map(function (obj) { return LNbits.map.payment(obj); }).sort(function (a, b) { @@ -326,7 +326,7 @@ new Vue({ }, watch: { 'payments': function () { - EventHub.$emit('update-wallet-balance', [this.w.wallet.id, this.balance]); + EventHub.$emit('update-wallet-balance', [this.g.wallet.id, this.balance]); } }, created: function () { diff --git a/lnbits/core/templates/core/extensions.html b/lnbits/core/templates/core/extensions.html index 4c8250088..7638beb79 100644 --- a/lnbits/core/templates/core/extensions.html +++ b/lnbits/core/templates/core/extensions.html @@ -13,7 +13,7 @@ {% block page %}
A magical "w" is always available, with info about the user, wallets and extensions:
-{% raw %}{{ w }}{% endraw %}
+ A magical "g" is always available, with info about the user, wallets and extensions:
+{% raw %}{{ g }}{% endraw %}
{% endblock %}
diff --git a/lnbits/static/js/base.js b/lnbits/static/js/base.js
index b0cd78b99..55d8c2676 100644
--- a/lnbits/static/js/base.js
+++ b/lnbits/static/js/base.js
@@ -141,7 +141,7 @@ var LNbits = {
var windowMixin = {
data: function () {
return {
- w: {
+ g: {
visibleDrawer: false,
extensions: [],
user: null,
@@ -165,14 +165,14 @@ var windowMixin = {
created: function () {
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'));
if (window.user) {
- this.w.user = Object.freeze(LNbits.map.user(window.user));
+ this.g.user = Object.freeze(LNbits.map.user(window.user));
}
if (window.wallet) {
- this.w.wallet = Object.freeze(LNbits.map.wallet(window.wallet));
+ this.g.wallet = Object.freeze(LNbits.map.wallet(window.wallet));
}
if (window.extensions) {
- var user = this.w.user;
- this.w.extensions = Object.freeze(window.extensions.map(function (data) {
+ var user = this.g.user;
+ this.g.extensions = Object.freeze(window.extensions.map(function (data) {
return LNbits.map.extension(data);
}).map(function (obj) {
if (user) {
diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html
index 450ad740e..a2f1c1259 100644
--- a/lnbits/templates/base.html
+++ b/lnbits/templates/base.html
@@ -19,7 +19,7 @@