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

View file

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