Added basic search and jump function

This commit is contained in:
Alexis
2024-04-05 16:45:17 +02:00
parent 14d50c921d
commit fda2e05d99
6 changed files with 173 additions and 67 deletions

View File

@@ -73,6 +73,10 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
})
})
const allEvents = computed(() => {
return [...characterBirthEvents.value, ...characterDeathEvents.value, ...baseEvents.value]
})
// Gets all current event in its default state
const currentEvents: Ref<CalendarEvent[]> = ref(computeCurrentEvents())
@@ -123,14 +127,8 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
* @returns A list of events that can appear in the current view
*/
function computeCurrentEvents(): CalendarEvent[] {
const allEvents = [
...characterBirthEvents.value,
...characterDeathEvents.value,
...baseEvents.value
]
return allEvents.filter((event) => shouldEventBeDisplayed(event))
return allEvents.value.filter((event) => shouldEventBeDisplayed(event))
}
return { currentEvents }
return { allEvents, currentEvents }
})