diff --git a/package.json b/package.json index e98ed89..de56bdc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "skate-spots", "private": true, - "version": "1.2.28", + "version": "1.2.29", "type": "module", "homepage": "https://skate-spots.com", "scripts": { diff --git a/src/pages/EditEventPage.tsx b/src/pages/EditEventPage.tsx index bddaa55..7e4016d 100644 --- a/src/pages/EditEventPage.tsx +++ b/src/pages/EditEventPage.tsx @@ -289,10 +289,26 @@ export default function EditEventPage() { tags.push(['image', image]); } - // Preserve sponsors from the original event (the edit form doesn't manage - // them yet, so carry them through untouched instead of dropping them). - for (const sponsorTag of event.event.tags.filter(([name]) => name === 'sponsor')) { - tags.push(sponsorTag); + // Carry through every tag the edit form doesn't manage, untouched. This + // is an addressable event, so re-publishing REPLACES the whole tag set — + // if we only rebuilt the fields on this form we'd silently strip linked + // spots/crews/tours/musicians, the entry fee, the paid "featured" (Pro) + // listing, sponsors, and any other tags an event was created with. + const MANAGED_TAGS = new Set([ + 'd', 'title', 'start', 'end', 'location', 'g', 'image', 'alt', + ]); + // `t` is special: we fully rebuild the topic tags this form owns + // (skateboarding + selected types), but must preserve OTHER `t` values + // like 'paid' that other parts of the app set. + const managedTopics = new Set(['skateboarding', ...selectedTypes]); + for (const tag of event.event.tags) { + const [name, value] = tag; + if (MANAGED_TAGS.has(name)) continue; + if (name === 't') { + if (!managedTopics.has(value)) tags.push(tag); // keep foreign topics (e.g. 'paid') + continue; + } + tags.push(tag); // a-refs, *-name, entry-fee, featured, sponsor, etc. } // Detect the changes attendees care about (time / location) BEFORE we