diff --git a/static/components/chat-dialog/chat-dialog.js b/static/components/chat-dialog/chat-dialog.js index c111e27..405992b 100644 --- a/static/components/chat-dialog/chat-dialog.js +++ b/static/components/chat-dialog/chat-dialog.js @@ -17,7 +17,7 @@ async function chatDialog(path) { }, computed: { sortedMessages() { - return this.nostrMessages.sort((a, b) => b.timestamp - a.timestamp) + return this.nostrMessages.sort((a, b) => b.created_at - a.created_at) } }, methods: { @@ -36,11 +36,11 @@ async function chatDialog(path) { let sub = this.pool.sub(Array.from(this.relays), [ { kinds: [4], - authors: [this.account.pubkey] + authors: [this.account.pubkey, this.merchant] }, { kinds: [4], - '#p': [this.account.pubkey] + '#p': [this.account.pubkey, this.merchant] } ]) sub.on('eose', () => { @@ -68,18 +68,16 @@ async function chatDialog(path) { ) } messagesMap.set(event.id, { + created_at: event.created_at, msg: plaintext, timestamp: timeFromNow(event.created_at * 1000), sender: `${mine ? 'Me' : 'Merchant'}` }) + this.nostrMessages = Array.from(messagesMap.values()) } catch { console.error('Unable to decrypt message!') } }) - setTimeout(() => { - this.nostrMessages = Array.from(messagesMap.values()) - this.loading = false - }, 5000) }, async sendMessage() { if (this.newMessage && this.newMessage.length < 1) return diff --git a/static/components/customer-stall/customer-stall.html b/static/components/customer-stall/customer-stall.html index 572b90e..750d1e7 100644 --- a/static/components/customer-stall/customer-stall.html +++ b/static/components/customer-stall/customer-stall.html @@ -15,7 +15,7 @@ @@ -80,8 +80,8 @@
  • use a Nostr Signer Extension (NIP07)
  • - fill out the required fields, without keys, and download the - order and send as a direct message to the merchant on any + fill out the required fields, with your publickey, download + the order and send as a direct message to the merchant on any Nostr client
  • @@ -95,15 +95,6 @@ label="Get from Extension" >Use a Nostr browser extension - Download the order and send manually @@ -123,7 +114,7 @@ :type="isPwd ? 'password' : 'text'" v-if="!customerUseExtension" v-model.trim="checkoutDialog.data.privkey" - label="Private key" + label="Private key *optional" hint="Enter your private key" >