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:
parent
9b1b56e05d
commit
a77bf7ff6c
1 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue