fix search error
This commit is contained in:
parent
856ad53b7e
commit
d24ed52879
1 changed files with 21 additions and 9 deletions
|
|
@ -196,6 +196,12 @@ const market = async () => {
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
async updateData(events) {
|
async updateData(events) {
|
||||||
|
if (events.length < 1) {
|
||||||
|
this.$q.notify({
|
||||||
|
message: 'No matches were found!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
let products = new Map()
|
let products = new Map()
|
||||||
let stalls = new Map()
|
let stalls = new Map()
|
||||||
|
|
||||||
|
|
@ -215,15 +221,21 @@ const market = async () => {
|
||||||
|
|
||||||
this.stalls = await Array.from(stalls.values())
|
this.stalls = await Array.from(stalls.values())
|
||||||
|
|
||||||
this.products = Array.from(products.values()).map(obj => {
|
this.products = Array.from(products.values())
|
||||||
let stall = this.stalls.find(s => s.id == obj.stall_id)
|
.map(obj => {
|
||||||
obj.stallName = stall.name
|
let stall = this.stalls.find(s => s.id == obj.stall_id)
|
||||||
obj.images = [obj.image]
|
if (!stall) return
|
||||||
if (obj.currency != 'sat') {
|
obj.stallName = stall.name
|
||||||
obj.formatedPrice = this.getAmountFormated(obj.price, obj.currency)
|
obj.images = [obj.image]
|
||||||
}
|
if (obj.currency != 'sat') {
|
||||||
return obj
|
obj.formatedPrice = this.getAmountFormated(
|
||||||
})
|
obj.price,
|
||||||
|
obj.currency
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
.filter(f => f)
|
||||||
},
|
},
|
||||||
async initNostr() {
|
async initNostr() {
|
||||||
this.$q.loading.show()
|
this.$q.loading.show()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue