feat(activities): editingEvent in activities store

Carry the LNbits event being edited at store level so the
shell-mounted CreateEventDialog (activities-app/App.vue) can open in
edit mode from anywhere a user surfaces their own event — most
importantly the activity detail page, which is where they actually
land when fixing a posting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-21 16:01:55 +02:00
commit a77bf7ff6c

View file

@ -1,6 +1,7 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import type { Activity } from '../types/activity' import type { Activity } from '../types/activity'
import type { TicketedEvent } from '../types/ticket'
/** /**
* Pinia store for cached activities from Nostr relays. * Pinia store for cached activities from Nostr relays.
@ -14,6 +15,9 @@ export const useActivitiesStore = defineStore('activities', () => {
/** Toggle by the standalone bottom-nav Create tab; mounted dialog lives /** Toggle by the standalone bottom-nav Create tab; mounted dialog lives
* in activities-app/App.vue so it's available from every route. */ * in activities-app/App.vue so it's available from every route. */
const showCreateDialog = ref(false) const showCreateDialog = ref(false)
/** When set, the shell-mounted CreateEventDialog opens in edit mode
* for this LNbits event. Cleared when the dialog closes. */
const editingEvent = ref<TicketedEvent | null>(null)
// Computed // Computed
const activities = computed(() => Array.from(activitiesMap.value.values())) const activities = computed(() => Array.from(activitiesMap.value.values()))
@ -88,6 +92,7 @@ export const useActivitiesStore = defineStore('activities', () => {
isLoading, isLoading,
lastUpdated, lastUpdated,
showCreateDialog, showCreateDialog,
editingEvent,
// Computed // Computed
activities, activities,