diff --git a/package.json b/package.json index a00873c..7ba1032 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "skate-spots", "private": true, - "version": "1.2.30", + "version": "1.2.31", "type": "module", "homepage": "https://skate-spots.com", "scripts": { diff --git a/src/pages/CreateShopPage.tsx b/src/pages/CreateShopPage.tsx index ee1ac4c..4893b55 100644 --- a/src/pages/CreateShopPage.tsx +++ b/src/pages/CreateShopPage.tsx @@ -220,12 +220,6 @@ export default function CreateShopPage() { tags.push(['imeta', `url ${imageUrl}`, 'm image/jpeg']); } - console.log('Publishing shop event:', { - kind: SKATE_SHOP_KIND, - tags, - content: description.trim() - }); - await createEvent({ kind: SKATE_SHOP_KIND, content: description.trim(), diff --git a/src/pages/EditShopPage.tsx b/src/pages/EditShopPage.tsx index ebd6af6..d72e465 100644 --- a/src/pages/EditShopPage.tsx +++ b/src/pages/EditShopPage.tsx @@ -263,6 +263,26 @@ export default function EditShopPage() { tags.push(['imeta', `url ${imageUrl}`, 'm image/jpeg']); } + // Carry through any tag this form doesn't manage, untouched. A shop is an + // addressable NIP-15 stall, so re-publishing REPLACES the whole tag set — + // rebuilding only the fields on this form would silently strip anything + // else the stall carries (e.g. currency/shipping from another client, or + // future tags), just like the event-edit fix. `t` is special: this form + // owns the 'skateshop' marker, so keep every OTHER topic tag. + const MANAGED_TAGS = new Set([ + 'd', 'name', 'g', 'lat', 'lon', 'location', 'alt', + 'phone', 'email', 'website', 'instagram', 'hours', 'noffer', 'imeta', + ]); + for (const tag of shop.event.tags) { + const [tagName, tagValue] = tag; + if (MANAGED_TAGS.has(tagName)) continue; + if (tagName === 't') { + if (tagValue !== 'skateshop') tags.push(tag); // keep foreign topics + continue; + } + tags.push(tag); + } + await createEvent({ kind: SKATE_SHOP_KIND, content: description.trim(),