diff --git a/static/js/market.js b/static/js/market.js index 09769ee..261c87c 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -53,8 +53,8 @@ const market = async () => { merchants: [], shoppingCarts: [], - showMarketConfig: false, - showShoppingCartList: false, + activePage: 'market', + searchNostr: false, drawer: true, pubkeys: new Set(), @@ -460,11 +460,12 @@ const market = async () => { } else { this.activeStall = null this.activeProduct = null - this.showMarketConfig = false - this.showShoppingCartList = false + url.searchParams.delete('merchant_pubkey') url.searchParams.delete('stall_id') url.searchParams.delete('product_id') + + this.setActivePage('market') } window.history.pushState({}, '', url) @@ -541,6 +542,9 @@ const market = async () => { this.initNostr() }, + setActivePage(page = 'market'){ + this.activePage = page + }, addMerchant(publicKey) { console.log('### addMerchat', publicKey) diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index be301ee..5f4d6a2 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -172,10 +172,9 @@ Search + @click="setActivePage('search-nostr')">Search for products on Nostr - + Settings User Login @@ -183,7 +182,7 @@ size="lg">User Config Shopping + @click="setActivePage('shopping-cart-list')">Shopping Cart @@ -203,9 +202,10 @@ - - +