fix: shipping cost; update UI on new order

This commit is contained in:
Vlad Stan 2023-04-03 11:57:55 +03:00
parent f80a75e90c
commit 547c477ce6
11 changed files with 57 additions and 23 deletions

View file

@ -113,9 +113,7 @@ const merchant = async () => {
const port = location.port ? `:${location.port}` : ''
const wsUrl = `${scheme}://${document.domain}${port}/api/v1/ws/${this.merchant.id}`
const wsConnection = new WebSocket(wsUrl)
console.log('### waiting for events')
wsConnection.onmessage = async e => {
console.log('### e', e)
const data = JSON.parse(e.data)
if (data.type === 'new-order') {
this.$q.notify({
@ -126,6 +124,7 @@ const merchant = async () => {
await this.$refs.orderListRef.addOrder(data)
} else if (data.type === 'new-customer') {
} else if (data.type === 'new-direct-message') {
await this.$refs.directMessagesRef.handleNewMessage(data)
}
}
} catch (error) {