diff --git a/src/modules/market/composables/useMarket.ts b/src/modules/market/composables/useMarket.ts index e4c8828..a25d827 100644 --- a/src/modules/market/composables/useMarket.ts +++ b/src/modules/market/composables/useMarket.ts @@ -291,6 +291,13 @@ export function useMarket() { const productData = JSON.parse(latestEvent.content) const stallId = productData.stall_id || 'unknown' + // Extract categories from Nostr event tags (standard approach) + const categories = latestEvent.tags + .filter((tag: any) => tag[0] === 't') + .map((tag: any) => tag[1]) + .filter((cat: string) => cat && cat.trim()) + + // Look up the stall name from the stalls array const stall = marketStore.stalls.find(s => s.id === stallId) const stallName = stall?.name || 'Unknown Stall' @@ -305,7 +312,7 @@ export function useMarket() { currency: productData.currency || 'sats', quantity: productData.quantity || 1, images: productData.images || [], - categories: productData.categories || [], + categories: categories, createdAt: latestEvent.created_at, updatedAt: latestEvent.created_at } @@ -476,6 +483,12 @@ export function useMarket() { const productData = JSON.parse(event.content) const stallId = productData.stall_id || 'unknown' + // Extract categories from Nostr event tags (standard approach) + const categories = event.tags + .filter((tag: any) => tag[0] === 't') + .map((tag: any) => tag[1]) + .filter((cat: string) => cat && cat.trim()) + // Look up the stall name from the stalls array const stall = marketStore.stalls.find(s => s.id === stallId) const stallName = stall?.name || 'Unknown Stall' @@ -491,7 +504,7 @@ export function useMarket() { currency: productData.currency || 'sats', quantity: productData.quantity || 1, images: productData.images || [], - categories: productData.categories || [], + categories: categories, createdAt: event.created_at, updatedAt: event.created_at } diff --git a/src/modules/market/views/MarketPage.vue b/src/modules/market/views/MarketPage.vue index ffe9dd7..85acaaf 100644 --- a/src/modules/market/views/MarketPage.vue +++ b/src/modules/market/views/MarketPage.vue @@ -52,10 +52,11 @@ +