fix: navigation link
This commit is contained in:
parent
2518715110
commit
12349aa344
1 changed files with 7 additions and 7 deletions
|
|
@ -541,14 +541,12 @@ const market = async () => {
|
||||||
},
|
},
|
||||||
navigateTo(page, opts = { stall: null, product: null, pubkey: null }) {
|
navigateTo(page, opts = { stall: null, product: null, pubkey: null }) {
|
||||||
console.log("### navigateTo", page, opts)
|
console.log("### navigateTo", page, opts)
|
||||||
let { stall, product, pubkey } = opts
|
|
||||||
let url = new URL(window.location)
|
|
||||||
|
|
||||||
if (pubkey) url.searchParams.set('merchant', pubkey)
|
const { stall, product, pubkey } = opts
|
||||||
if (stall && !pubkey) {
|
const url = new URL(window.location)
|
||||||
pubkey = this.stalls.find(s => s.id == stall).pubkey
|
|
||||||
url.searchParams.set('merchant', pubkey)
|
const merchantPubkey = pubkey || this.stalls.find(s => s.id == stall)?.pubkey
|
||||||
}
|
url.searchParams.set('merchant', merchantPubkey)
|
||||||
|
|
||||||
if (page === 'stall' || page === 'product') {
|
if (page === 'stall' || page === 'product') {
|
||||||
if (stall) {
|
if (stall) {
|
||||||
|
|
@ -559,6 +557,8 @@ const market = async () => {
|
||||||
this.activeProduct = product
|
this.activeProduct = product
|
||||||
if (product) {
|
if (product) {
|
||||||
url.searchParams.set('product', product)
|
url.searchParams.set('product', product)
|
||||||
|
} else {
|
||||||
|
url.searchParams.delete('product')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue