diff --git a/static/components/market-config/market-config.js b/static/components/market-config/market-config.js index 6b36897..0bcf3f6 100644 --- a/static/components/market-config/market-config.js +++ b/static/components/market-config/market-config.js @@ -8,7 +8,6 @@ async function marketConfig(path) { data: function () { return { tab: 'merchants', - profiles: new Map(), merchantPubkey: null, relayUrl: null, configData: { diff --git a/static/js/market.js b/static/js/market.js index 3fb6db4..a08375d 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -78,7 +78,6 @@ const market = async () => { filterCategories: [], groupByStall: false, - drawer: true, relays: new Set(), events: [], stalls: [], @@ -87,6 +86,7 @@ const market = async () => { bannerImage: null, logoImage: null, + isLoading: false, profiles: new Map(), @@ -191,9 +191,6 @@ const market = async () => { this.products.find(p => p.id == this.activeProduct)?.name || 'Product' ) }, - isLoading() { - return this.$q.loading.isActive - }, hasExtension() { return window.nostr }, @@ -238,10 +235,10 @@ const market = async () => { // Get notes from Nostr await this.initNostr() - this.$q.loading.hide() await this.listenForIncommingDms(this.merchants.map(m => ({ publicKey: m.publicKey, since: this.lastDmForPubkey(m.publicKey) }))) + this.isLoading = false }, methods: { async handleQueryParams(params) { @@ -414,7 +411,7 @@ const market = async () => { .filter(f => f) }, async initNostr() { - this.$q.loading.show() + this.isLoading = true const pool = new NostrTools.SimplePool() let relays = Array.from(this.relays) @@ -432,10 +429,10 @@ const market = async () => { await this.updateData(events) }) - this.$q.loading.hide() + this.pool = pool this.poolSubscribe() - return + this.isLoading = false }, async poolSubscribe() { const authors = this.merchants.map(m => m.publicKey) @@ -908,6 +905,7 @@ const market = async () => { event.id = NostrTools.getEventHash(event) try { event.sig = await NostrTools.signEvent(event, this.account.privkey) + const pub = this.pool.publish(Array.from(this.relays), event) pub.on('ok', () => { console.debug(`Config event was sent`) diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index 7fc63f4..e30c688 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -69,6 +69,10 @@
+
+
+
+
@@ -87,6 +91,7 @@
+