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