Refactored the store system
This commit is contained in:
@@ -8,8 +8,6 @@ import {
|
||||
isCalendarEvent,
|
||||
type CalendarEvent,
|
||||
} from '~/models/CalendarEvent'
|
||||
import { useCharacters } from '@/stores/CharacterStore'
|
||||
import { useCalendarEvents } from '@/stores/EventStore'
|
||||
import { capitalize } from '@/utils/Strings'
|
||||
import { useMagicKeys, useScroll, useStorage, whenever } from '@vueuse/core'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
@@ -27,8 +25,7 @@ import {
|
||||
import SearchList from './lists/SearchList.vue'
|
||||
import type { Category } from '~/models/Category'
|
||||
|
||||
const { isAdvancedSearchOpen } = storeToRefs(useCalendar())
|
||||
const { allEvents } = storeToRefs(useCalendarEvents())
|
||||
const { isAdvancedSearchOpen, allEvents } = storeToRefs(useCalendar())
|
||||
const { characters } = storeToRefs(useCharacters())
|
||||
|
||||
const searchQuery = ref<string>('')
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { cn } from '@/lib/utils'
|
||||
import type { RPGDate } from '@/models/Date'
|
||||
import type { CalendarEvent } from '@/models/CalendarEvent'
|
||||
import { useCalendar } from '@/stores/CalendarStore'
|
||||
|
||||
import { PhArrowSquareOut, PhHourglassMedium, PhAlarm, PhMapPinArea, PhEye } from '@phosphor-icons/vue'
|
||||
|
||||
@@ -14,9 +13,7 @@ defineEmits<{
|
||||
(e: 'query:date-jump', payload: RPGDate): void
|
||||
}>()
|
||||
|
||||
const { getRelativeString } = useCalendar()
|
||||
|
||||
const { defaultDate, getFormattedDateTitle } = useCalendar()
|
||||
const { getRelativeString, defaultDate, getFormattedDateTitle } = useCalendar()
|
||||
|
||||
const dateDifference: string = getRelativeString(defaultDate, props.event.startDate)
|
||||
const dateDuration: string | null = props.event.endDate
|
||||
|
||||
Reference in New Issue
Block a user