chore: small stuff
This commit is contained in:
parent
d0b2ec1250
commit
fa375a23b4
2 changed files with 19 additions and 12 deletions
|
|
@ -7,7 +7,8 @@ const market = async () => {
|
||||||
'wss://relay.damus.io',
|
'wss://relay.damus.io',
|
||||||
'wss://relay.snort.social',
|
'wss://relay.snort.social',
|
||||||
'wss://nostr-pub.wellorder.net',
|
'wss://nostr-pub.wellorder.net',
|
||||||
'wss://nostr.zebedee.cloud'
|
'wss://nostr.zebedee.cloud',
|
||||||
|
'wss://nostr.walletofsatoshi.com'
|
||||||
]
|
]
|
||||||
const eventToObj = event => {
|
const eventToObj = event => {
|
||||||
event.content = JSON.parse(event.content) || null
|
event.content = JSON.parse(event.content) || null
|
||||||
|
|
@ -764,15 +765,15 @@ const market = async () => {
|
||||||
},
|
},
|
||||||
|
|
||||||
handlePaymentRequest(json) {
|
handlePaymentRequest(json) {
|
||||||
if (!json.payment_options?.length) {
|
|
||||||
this.qrCodeDialog.data.message = json.message || 'Unexpected error'
|
|
||||||
console.log('### qrCodeDialog.data.message', this.qrCodeDialog.data.message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (json.id && (json.id !== this.activeOrderId)) {
|
if (json.id && (json.id !== this.activeOrderId)) {
|
||||||
// not for active order, store somewehre else
|
// not for active order, store somewehre else
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!json.payment_options?.length) {
|
||||||
|
this.qrCodeDialog.data.message = json.message || 'Unexpected error'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const paymentRequest = json.payment_options.find(o => o.type == 'ln')
|
const paymentRequest = json.payment_options.find(o => o.type == 'ln')
|
||||||
.link
|
.link
|
||||||
if (!paymentRequest) return
|
if (!paymentRequest) return
|
||||||
|
|
@ -785,6 +786,10 @@ const market = async () => {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleOrderStatusUpdate(jsonData) {
|
handleOrderStatusUpdate(jsonData) {
|
||||||
|
if (jsonData.id && (jsonData.id !== this.activeOrderId)) {
|
||||||
|
// not for active order, store somewehre else
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.qrCodeDialog.dismissMsg) {
|
if (this.qrCodeDialog.dismissMsg) {
|
||||||
this.qrCodeDialog.dismissMsg()
|
this.qrCodeDialog.dismissMsg()
|
||||||
}
|
}
|
||||||
|
|
@ -819,7 +824,7 @@ const market = async () => {
|
||||||
console.log('### persistOrderUpdate', pubkey, eventCreatedAt, orderUpdate)
|
console.log('### persistOrderUpdate', pubkey, eventCreatedAt, orderUpdate)
|
||||||
let orders = this.$q.localStorage.getItem(`nostrmarket.orders.${pubkey}`) || []
|
let orders = this.$q.localStorage.getItem(`nostrmarket.orders.${pubkey}`) || []
|
||||||
const orderIndex = orders.findIndex(o => o.id === orderUpdate.id)
|
const orderIndex = orders.findIndex(o => o.id === orderUpdate.id)
|
||||||
|
|
||||||
if (orderIndex === -1) {
|
if (orderIndex === -1) {
|
||||||
orders.unshift({
|
orders.unshift({
|
||||||
...orderUpdate,
|
...orderUpdate,
|
||||||
|
|
@ -827,7 +832,7 @@ const market = async () => {
|
||||||
createdAt: eventCreatedAt
|
createdAt: eventCreatedAt
|
||||||
})
|
})
|
||||||
this.orders[pubkey] = orders
|
this.orders[pubkey] = orders
|
||||||
this.orders = {...this.orders}
|
this.orders = { ...this.orders }
|
||||||
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -844,7 +849,7 @@ const market = async () => {
|
||||||
// orders = [order].concat(orders.filter(o => o.id !== order.id))
|
// orders = [order].concat(orders.filter(o => o.id !== order.id))
|
||||||
orders.splice(orderIndex, 1, order)
|
orders.splice(orderIndex, 1, order)
|
||||||
this.orders[pubkey] = orders
|
this.orders[pubkey] = orders
|
||||||
this.orders = {...this.orders}
|
this.orders = { ...this.orders }
|
||||||
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
this.$q.localStorage.set(`nostrmarket.orders.${pubkey}`, orders)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@
|
||||||
<div class="col-lg-8 col-md-10 col-sm-12 auto-width">
|
<div class="col-lg-8 col-md-10 col-sm-12 auto-width">
|
||||||
|
|
||||||
<div class="row q-mb-md">
|
<div class="row q-mb-md">
|
||||||
<q-toolbar class="col-lg-8 col-md-7 col-sm-6 auto-width">
|
<q-toolbar class="col-lg-7 col-md-6 col-sm-12 auto-width">
|
||||||
<q-input class="rounded-pill" style="width:100%;" rounded outlined clearable v-model.trim="searchText"
|
<q-input class="rounded-pill" style="width:100%;" rounded outlined clearable v-model.trim="searchText"
|
||||||
label="Filter products">
|
label="Filter products">
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-toolbar class="col-lg-4 col-md-5 col-sm-6">
|
<q-toolbar class="col-lg-5 col-md-6 col-sm-12 q-ma-none">
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<q-btn color="gray" icon="travel_explore" flat size="lg"
|
<q-btn color="gray" icon="travel_explore" flat size="lg"
|
||||||
@click="setActivePage('search-nostr')"><q-tooltip>Search
|
@click="setActivePage('search-nostr')"><q-tooltip>Search
|
||||||
|
|
@ -181,7 +181,9 @@
|
||||||
<q-btn v-else @click="accountDialog.show = true" color="gray" icon="person_add" flat
|
<q-btn v-else @click="accountDialog.show = true" color="gray" icon="person_add" flat
|
||||||
size="lg"><q-tooltip>User
|
size="lg"><q-tooltip>User
|
||||||
Config</q-tooltip></q-btn>
|
Config</q-tooltip></q-btn>
|
||||||
<q-btn @click="setActivePage('customer-orders')" color="gray" icon="receipt_long" flat
|
<q-btn color="gray" icon="chat" flat
|
||||||
|
size="lg"><q-tooltip>Chat</q-tooltip></q-btn>
|
||||||
|
<q-btn @click="setActivePage('customer-orders')" color="gray" icon="receipt_long" flat
|
||||||
size="lg"><q-tooltip>Orders</q-tooltip></q-btn>
|
size="lg"><q-tooltip>Orders</q-tooltip></q-btn>
|
||||||
<q-btn color="gray" icon="shopping_cart" dense round flat size="lg"
|
<q-btn color="gray" icon="shopping_cart" dense round flat size="lg"
|
||||||
@click="setActivePage('shopping-cart-list')">
|
@click="setActivePage('shopping-cart-list')">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue