From 260bea9ccf463d6af383d3782ba245f9d722a5ac Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 23 Mar 2023 09:47:40 +0200 Subject: [PATCH] fix: clear merchant screen on delete --- static/js/index.js | 6 ++++++ templates/nostrmarket/index.html | 1 + 2 files changed, 7 insertions(+) diff --git a/static/js/index.js b/static/js/index.js index 75e6f01..12c354e 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -59,6 +59,12 @@ const merchant = async () => { toggleMerchantKeys: function (value) { this.showKeys = value }, + handleMerchantDeleted: function() { + this.merchant = null + this.shippingZones = [] + this.activeChatCustomer = '' + this.showKeys = false + }, createMerchant: async function (privateKey) { try { const pubkey = nostr.getPublicKey(privateKey) diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index 1d89485..94aa403 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -12,6 +12,7 @@ :inkey="g.user.wallets[0].inkey" :adminkey="g.user.wallets[0].adminkey" @show-keys="toggleMerchantKeys" + @merchant-deleted="handleMerchantDeleted" >