Calendar-attendance-fix #108
@@ -64,11 +64,11 @@ const maybe = computed<CalendarSignup[]>(() => { return activeEvent.value.eventS
|
||||
const declined = computed<CalendarSignup[]>(() => { return activeEvent.value.eventSignups.filter((s) => s.status == CalendarAttendance.NotAttending) })
|
||||
const viewedState = ref<CalendarAttendance>(CalendarAttendance.Attending);
|
||||
|
||||
let user = useUserStore();
|
||||
let userStore = useUserStore();
|
||||
const myAttendance = computed<CalendarSignup | null>(() => {
|
||||
if (!user.isLoggedIn) return null;
|
||||
if (!userStore.isLoggedIn) return null;
|
||||
return activeEvent.value.eventSignups.find(
|
||||
(s) => s.member_id === user.user.id
|
||||
(s) => s.member_id === userStore.user.member.member_id
|
||||
) || null;
|
||||
});
|
||||
|
||||
@@ -79,8 +79,8 @@ async function setAttendance(state: CalendarAttendance) {
|
||||
}
|
||||
|
||||
const canEditEvent = computed(() => {
|
||||
if (!user.isLoggedIn) return false;
|
||||
if (user.user.id == activeEvent.value.creator_id)
|
||||
if (!userStore.isLoggedIn) return false;
|
||||
if (userStore.user.member.member_id == activeEvent.value.creator_id)
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -215,7 +215,7 @@ defineExpose({ forceReload })
|
||||
<CircleAlert></CircleAlert> This event has been cancelled
|
||||
</div>
|
||||
</section>
|
||||
<section v-if="isPast && user.isLoggedIn" class="w-full">
|
||||
<section v-if="isPast && userStore.isLoggedIn" class="w-full">
|
||||
<ButtonGroup class="flex w-full">
|
||||
<Button variant="outline"
|
||||
:class="myAttendance?.status === CalendarAttendance.Attending ? 'border-2 border-primary text-primary' : ''"
|
||||
|
||||
Reference in New Issue
Block a user