diff --git a/static/components/merchant-details/merchant-details.html b/static/components/merchant-details/merchant-details.html index 35f9e31..e48a8e8 100644 --- a/static/components/merchant-details/merchant-details.html +++ b/static/components/merchant-details/merchant-details.html @@ -15,7 +15,7 @@ > - + Show Keys Hide Keys diff --git a/static/components/merchant-details/merchant-details.js b/static/components/merchant-details/merchant-details.js index 31dcfac..ed78226 100644 --- a/static/components/merchant-details/merchant-details.js +++ b/static/components/merchant-details/merchant-details.js @@ -2,18 +2,16 @@ async function merchantDetails(path) { const template = await loadTemplateAsync(path) Vue.component('merchant-details', { name: 'merchant-details', - props: ['merchant-id', 'adminkey', 'inkey'], + props: ['merchant-id', 'adminkey', 'inkey','showKeys'], template, data: function () { return { - showKeys: false } }, methods: { - toggleMerchantKeys: async function () { - this.showKeys = !this.showKeys - this.$emit('show-keys', this.showKeys) + toggleShowKeys: async function () { + this.$emit('toggle-show-keys') }, republishMerchantData: async function () { diff --git a/static/js/index.js b/static/js/index.js index 72f1607..4e8cf2f 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -58,8 +58,8 @@ const merchant = async () => { showImportKeysDialog: async function () { this.importKeyDialog.show = true }, - toggleMerchantKeys: function (value) { - this.showKeys = value + toggleShowKeys: function () { + this.showKeys = !this.showKeys }, toggleMerchantState: async function () { const merchant = await this.getMerchant() diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index c39eb32..e7296c3 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -11,7 +11,8 @@ :merchant-id="merchant.id" :inkey="g.user.wallets[0].inkey" :adminkey="g.user.wallets[0].adminkey" - @show-keys="toggleMerchantKeys" + :show-keys="showKeys" + @toggle-show-keys="toggleShowKeys" @merchant-deleted="handleMerchantDeleted" >