From d24ed528791a1d8fb5bdb8ebabe9996b901fac5c Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:19:49 +0000 Subject: [PATCH 01/11] fix search error --- static/js/market.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/static/js/market.js b/static/js/market.js index ea7b4c8..80063b6 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -196,6 +196,12 @@ const market = async () => { return }, async updateData(events) { + if (events.length < 1) { + this.$q.notify({ + message: 'No matches were found!' + }) + return + } let products = new Map() let stalls = new Map() @@ -215,15 +221,21 @@ const market = async () => { this.stalls = await Array.from(stalls.values()) - this.products = Array.from(products.values()).map(obj => { - let stall = this.stalls.find(s => s.id == obj.stall_id) - obj.stallName = stall.name - obj.images = [obj.image] - if (obj.currency != 'sat') { - obj.formatedPrice = this.getAmountFormated(obj.price, obj.currency) - } - return obj - }) + this.products = Array.from(products.values()) + .map(obj => { + let stall = this.stalls.find(s => s.id == obj.stall_id) + if (!stall) return + obj.stallName = stall.name + obj.images = [obj.image] + if (obj.currency != 'sat') { + obj.formatedPrice = this.getAmountFormated( + obj.price, + obj.currency + ) + } + return obj + }) + .filter(f => f) }, async initNostr() { this.$q.loading.show() From a0d8aa9e6210781a8ef6131f646cce45942828cd Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:24:35 +0000 Subject: [PATCH 02/11] respect stored relay list --- static/js/market.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/market.js b/static/js/market.js index 80063b6..e2297d0 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -114,7 +114,7 @@ const market = async () => { this.pubkeys.add(this.account.pubkey) } if (relays && relays.length) { - this.relays = new Set([...defaultRelays, ...relays]) + this.relays = relays } else { this.relays = new Set(defaultRelays) } From 90b044fb22d0b85057f25704c423c36ab8aa2f6e Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:26:53 +0000 Subject: [PATCH 03/11] make address field optional --- static/components/customer-stall/customer-stall.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html index 2afd57a..522ea70 100644 --- a/static/components/customer-stall/customer-stall.html +++ b/static/components/customer-stall/customer-stall.html @@ -141,7 +141,8 @@ filled dense v-model.trim="checkoutDialog.data.address" - label="Address" + label="Address *optional" + hint="If ordering a physical product make sure to fill this" > Download OrderCheckout Date: Wed, 15 Mar 2023 11:32:44 +0000 Subject: [PATCH 04/11] less windows spinners --- static/components/chat-dialog/chat-dialog.html | 2 +- static/components/customer-stall/customer-stall.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/components/chat-dialog/chat-dialog.html b/static/components/chat-dialog/chat-dialog.html index 7eddfc0..e163c25 100644 --- a/static/components/chat-dialog/chat-dialog.html +++ b/static/components/chat-dialog/chat-dialog.html @@ -82,7 +82,7 @@ - + diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html index 522ea70..b894845 100644 --- a/static/components/customer-stall/customer-stall.html +++ b/static/components/customer-stall/customer-stall.html @@ -225,7 +225,7 @@ - +
From 809429c9d2ecaf407af330deb8653b51e79fbed2 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:48:49 +0000 Subject: [PATCH 05/11] account for faulty stalls --- static/js/market.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/static/js/market.js b/static/js/market.js index e2297d0..2040f98 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -273,15 +273,21 @@ const market = async () => { await Promise.resolve(sub) this.stalls = await Array.from(stalls.values()) - this.products = Array.from(products.values()).map(obj => { - let stall = this.stalls.find(s => s.id == obj.stall_id) - obj.stallName = stall.name - obj.images = [obj.image] - if (obj.currency != 'sat') { - obj.formatedPrice = this.getAmountFormated(obj.price, obj.currency) - } - return obj - }) + this.products = Array.from(products.values()) + .map(obj => { + let stall = this.stalls.find(s => s.id == obj.stall_id) + if (!stall) return + obj.stallName = stall.name + obj.images = [obj.image] + if (obj.currency != 'sat') { + obj.formatedPrice = this.getAmountFormated( + obj.price, + obj.currency + ) + } + return obj + }) + .filter(f => f) this.$q.loading.hide() pool.close(relays) return From 1e56fa11a06c72affbe6361b2792a886063eba0c Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:53:10 +0000 Subject: [PATCH 06/11] fix dialog close error --- static/components/customer-stall/customer-stall.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/components/customer-stall/customer-stall.js b/static/components/customer-stall/customer-stall.js index d0b2d32..731a2c4 100644 --- a/static/components/customer-stall/customer-stall.js +++ b/static/components/customer-stall/customer-stall.js @@ -189,7 +189,6 @@ async function customerStall(path) { } }, closeQrCodeDialog() { - this.qrCodeDialog.dismissMsg() this.qrCodeDialog.show = false }, async placeOrder() { @@ -345,9 +344,8 @@ async function customerStall(path) { let json = JSON.parse(text) if (json.id != this.activeOrder) return if (json.payment_options) { - let payment_request = json.payment_options.find( - o => o.type == 'ln' - ).link + let payment_request = json.payment_options.find(o => o.type == 'ln') + .link if (!payment_request) return this.loading = false this.qrCodeDialog.data.payment_request = payment_request From f920e7d83642865bde7d9bd417f99ea3ff8c2dfb Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Wed, 15 Mar 2023 11:57:31 +0000 Subject: [PATCH 07/11] change optional display --- static/components/customer-stall/customer-stall.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html index b894845..ea37b72 100644 --- a/static/components/customer-stall/customer-stall.html +++ b/static/components/customer-stall/customer-stall.html @@ -60,7 +60,7 @@ filled dense v-model.trim="checkoutDialog.data.username" - label="Name *optional" + label="Name (optional)" >