feat: build the occurrence index
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import { useEntitiesStore } from '@ChronoManager/stores/entitiesStore'
|
||||
import { useServicesStore } from '@ChronoManager/stores/servicesStore'
|
||||
import { useImportStore } from '@ChronoManager/stores/importStore'
|
||||
import type { VisibleDateRange } from '@/types'
|
||||
import { buildOccurrenceIndex, occurrencesForRange } from '@/utils/occurrenceIndex'
|
||||
|
||||
type ChronoEntityProperties = EventObject | TaskObject
|
||||
|
||||
@@ -44,6 +45,10 @@ export const useChronoOperationsStore = defineStore('chronoOperationsStore', ()
|
||||
return events.value.filter(event => visibleCalendarIds.includes(event.collection))
|
||||
})
|
||||
const filteredTasks = computed(() => tasks.value)
|
||||
const occurrenceIndex = computed(() => buildOccurrenceIndex(filteredEvents.value))
|
||||
const visibleOccurrences = computed(() => visibleRange.value
|
||||
? occurrencesForRange(occurrenceIndex.value, visibleRange.value)
|
||||
: [])
|
||||
|
||||
function setVisibleRange(range: VisibleDateRange) {
|
||||
if (
|
||||
@@ -176,6 +181,8 @@ export const useChronoOperationsStore = defineStore('chronoOperationsStore', ()
|
||||
tasks,
|
||||
filteredEvents,
|
||||
filteredTasks,
|
||||
occurrenceIndex,
|
||||
visibleOccurrences,
|
||||
setVisibleRange,
|
||||
saveEntity,
|
||||
deleteEntity,
|
||||
|
||||
Reference in New Issue
Block a user