From af8af54376c899b28b58ceb2fd83cfdab1404271 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Tue, 9 Aug 2022 09:05:37 +0100 Subject: [PATCH] Fix/hotfix custom design (#850) * allow to toggle custom desing on and off * make custom design off by default, toggle custom design --- lnbits/extensions/withdraw/static/js/index.js | 12 ++++++++++-- .../withdraw/templates/withdraw/index.html | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/withdraw/static/js/index.js b/lnbits/extensions/withdraw/static/js/index.js index 1982d684..943e9024 100644 --- a/lnbits/extensions/withdraw/static/js/index.js +++ b/lnbits/extensions/withdraw/static/js/index.js @@ -70,7 +70,7 @@ new Vue({ show: false, data: { is_unique: true, - use_custom: true, + use_custom: false, title: 'Vouchers', min_withdrawable: 0, wait_time: 1 @@ -125,7 +125,6 @@ new Vue({ var link = _.findWhere(this.withdrawLinks, {id: linkId}) this.qrCodeDialog.data = _.clone(link) - console.log(this.qrCodeDialog.data) this.qrCodeDialog.data.url = window.location.protocol + '//' + window.location.host this.qrCodeDialog.show = true @@ -140,6 +139,11 @@ new Vue({ id: this.formDialog.data.wallet }) var data = _.omit(this.formDialog.data, 'wallet') + + if (!data.use_custom) { + data.custom_url = null + } + if (data.use_custom && !data?.custom_url) { data.custom_url = CUSTOM_URL } @@ -168,6 +172,10 @@ new Vue({ data.title = 'vouchers' data.is_unique = true + if (!data.use_custom) { + data.custom_url = null + } + if (data.use_custom && !data?.custom_url) { data.custom_url = '/static/images/default_voucher.png' } diff --git a/lnbits/extensions/withdraw/templates/withdraw/index.html b/lnbits/extensions/withdraw/templates/withdraw/index.html index 9ff428a1..b1d927af 100644 --- a/lnbits/extensions/withdraw/templates/withdraw/index.html +++ b/lnbits/extensions/withdraw/templates/withdraw/index.html @@ -241,7 +241,7 @@ v-model="formDialog.data.custom_url" type="text" label="Custom design .png (optional)" - hint="Enter a URL if you want to use a custom design or leave blank for showing only the QR" + hint="Enter a URL if you want to use a custom design or leave blank for LNbits designed vouchers!" > @@ -353,7 +353,7 @@ v-model="simpleformDialog.data.custom_url" type="text" label="Custom design .png (optional)" - hint="Enter a URL if you want to use a custom design or leave blank for showing only the QR" + hint="Enter a URL if you want to use a custom design or leave blank for LNbits designed vouchers!" >