fix add merchant pubkey

This commit is contained in:
Tiago Vasconcelos 2023-03-08 11:24:11 +00:00
parent 9926cc857b
commit 3dc3c96cb0
2 changed files with 7 additions and 3 deletions

View file

@ -222,6 +222,7 @@ const market = async () => {
})
})
await Promise.resolve(sub)
this.$q.loading.hide()
this.stalls = await Array.from(stalls.values())
this.products = Array.from(products.values()).map(obj => {
@ -272,7 +273,8 @@ const market = async () => {
getAmountFormated(amount, unit = 'USD') {
return LNbits.utils.formatCurrency(amount, unit)
},
async addPubkey(pubkey = null) {
async addPubkey(pubkey) {
console.log(pubkey, this.inputPubkey)
if (!pubkey) {
pubkey = String(this.inputPubkey).trim()
}
@ -285,6 +287,7 @@ const market = async () => {
pubkey = data.pubkey
givenRelays = data.relays
}
console.log(pubkey)
this.pubkeys.add(pubkey)
this.inputPubkey = null
} catch (err) {
@ -310,6 +313,7 @@ const market = async () => {
`diagonAlley.merchants`,
Array.from(this.pubkeys)
)
Promise.resolve(this.initNostr())
},
async addRelay() {
let relay = String(this.inputRelay).trim()

View file

@ -44,12 +44,12 @@
<q-input
filled
v-model="inputPubkey"
@keydown.enter="addPubkey"
@keydown.enter="addPubkey(null)"
type="text"
label="Pubkey/Npub"
hint="Add merchants"
>
<q-btn @click="addPubkey" dense flat icon="add"></q-btn>
<q-btn @click="addPubkey(null)" dense flat icon="add"></q-btn>
</q-input>
<q-list class="q-mt-md">
<q-item v-for="pub in Array.from(pubkeys)" :key="pub">