Fixed a whole lotta broken stuff by changing state from a string to a number
This commit is contained in:
@@ -12,6 +12,7 @@ import { useCalendarEvents } from '@/composables/useCalendarEvents'
|
||||
import { useCalendarNavigation } from '@/composables/useCalendarNavigation'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { CalendarOptions } from '@fullcalendar/core'
|
||||
import { MemberState } from '@shared/types/member'
|
||||
|
||||
const monthLabels = [
|
||||
'January', 'February', 'March', 'April', 'May', 'June',
|
||||
@@ -50,7 +51,7 @@ const dialogRef = ref<any>(null)
|
||||
// NEW: handle day/time slot clicks to start creating an event
|
||||
function onDateClick(arg: { dateStr: string }) {
|
||||
if (!userStore.isLoggedIn) return;
|
||||
if (userStore.state !== 'member') return;
|
||||
if (userStore.state !== MemberState.Member) return;
|
||||
dialogRef.value?.openDialog(arg.dateStr);
|
||||
}
|
||||
|
||||
@@ -198,7 +199,7 @@ onMounted(() => {
|
||||
@click="goToday">
|
||||
Today
|
||||
</button>
|
||||
<button v-if="userStore.isLoggedIn && userStore.state === 'member'"
|
||||
<button v-if="userStore.isLoggedIn && userStore.state === MemberState.Member"
|
||||
class="cursor-pointer ml-1 inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:opacity-90"
|
||||
@click="onCreateEvent">
|
||||
<Plus class="h-4 w-4" />
|
||||
|
||||
Reference in New Issue
Block a user