From 8d5aa813d32e4e2ff35f03de401c4eab69d89f26 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 5 Jul 2023 17:09:45 +0300 Subject: [PATCH] fix: navigation --- .../customer-stall/customer-stall.html | 4 +-- static/js/market.js | 31 +++++++++---------- templates/nostrmarket/market.html | 2 +- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html index 6075b56..c423349 100644 --- a/static/components/customer-stall/customer-stall.html +++ b/static/components/customer-stall/customer-stall.html @@ -9,8 +9,8 @@ @open-checkout="openCheckout"> --> -
-
+
+
diff --git a/static/js/market.js b/static/js/market.js index 65c978d..8f6eaa0 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -435,25 +435,22 @@ const market = async () => { url.searchParams.set('merchant_pubkey', pubkey) } - switch (page) { - case 'stall': - if (stall) { - this.activeStall = stall - url.searchParams.set('stall_id', stall) + if (page === 'stall' || page === 'product') { + if (stall) { + this.activeStall = stall + url.searchParams.set('stall_id', stall) - this.activeProduct = product - if (product) { - url.searchParams.set('product_id', product) - } + this.activeProduct = product + if (product) { + url.searchParams.set('product_id', product) } - break - default: - this.activeStall = null - this.activeProduct = null - url.searchParams.delete('merchant_pubkey') - url.searchParams.delete('stall_id') - url.searchParams.delete('product_id') - break + } + } else { + this.activeStall = null + this.activeProduct = null + url.searchParams.delete('merchant_pubkey') + url.searchParams.delete('stall_id') + url.searchParams.delete('product_id') } window.history.pushState({}, '', url) diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index ff3ef51..9892b32 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -191,7 +191,7 @@