diff --git a/static/components/stall-list.js b/static/components/stall-list.js index 0cdfb04..220b5c1 100644 --- a/static/components/stall-list.js +++ b/static/components/stall-list.js @@ -74,6 +74,9 @@ window.app.component('stall-list', { } }, methods: { + emitStallCount: function () { + this.$emit('stalls-updated', this.stalls.length) + }, sendStallFormData: async function () { const stallData = { name: this.stallDialog.data.name, @@ -101,6 +104,7 @@ window.app.component('stall-list', { ) this.stallDialog.show = false this.stalls.unshift(data) + this.emitStallCount() this.$q.notify({ type: 'positive', message: 'Stall created!' @@ -120,6 +124,7 @@ window.app.component('stall-list', { ) this.stallDialog.show = false this.stalls.unshift(data) + this.emitStallCount() this.$q.notify({ type: 'positive', message: 'Stall restored!' @@ -151,6 +156,7 @@ window.app.component('stall-list', { if (index !== -1) { this.stalls.splice(index, 1, data) } + this.emitStallCount() this.$q.notify({ type: 'positive', message: 'Stall updated!' @@ -168,6 +174,7 @@ window.app.component('stall-list', { ) this.stalls = this.stalls.filter(s => s.id !== stall.id) this.pendingStalls = this.pendingStalls.filter(s => s.id !== stall.id) + this.emitStallCount() this.$q.notify({ type: 'positive', message: 'Stall deleted' @@ -291,6 +298,7 @@ window.app.component('stall-list', { }, created: async function () { this.stalls = await this.getStalls() + this.emitStallCount() this.currencies = this.getCurrencies() this.zoneOptions = await this.getZones() } diff --git a/static/js/index.js b/static/js/index.js index e570dde..00560df 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -12,6 +12,7 @@ window.app = Vue.createApp({ activeChatCustomer: '', orderPubkey: null, showKeys: false, + stallCount: 0, importKeyDialog: { show: false, data: { @@ -114,6 +115,7 @@ window.app = Vue.createApp({ this.shippingZones = [] this.activeChatCustomer = '' this.showKeys = false + this.stallCount = 0 }, createMerchant: async function (privateKey) { try { @@ -378,7 +380,6 @@ window.app = Vue.createApp({ }, goToOrders: function (stallId) { this.selectedStallFilter = stallId - this.activeTab = 'orders' } }, created: async function () { diff --git a/templates/nostrmarket/components/direct-messages.html b/templates/nostrmarket/components/direct-messages.html index 9f68511..88ae2c0 100644 --- a/templates/nostrmarket/components/direct-messages.html +++ b/templates/nostrmarket/components/direct-messages.html @@ -1,143 +1,146 @@
- -
-
-
Messages
-
-
-   new -
-
- Client Orders -
-
-
- - - - -
-
- - - -
-
- - Add a public key to chat with - -
-
-
- -
-
-
- + +
+
+   new +
+
+ Client Orders -
-
- New order: -
-
- Reply sent for order: -
-
- Paid - Shipped - -
-
- - - - -
- ... -
-
-
- - - + +
+
+ -