mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-25 17:53:48 +02:00
Calendar isFollowing button
This commit is contained in:
@@ -35,7 +35,8 @@
|
||||
:event="value"
|
||||
mode="timeline"
|
||||
:is-following="isEventFollowing(value.id)"
|
||||
:card-class="{ 'grouped-card': timeGroup.events.length > 1 }" />
|
||||
:card-class="{ 'grouped-card': timeGroup.events.length > 1 }"
|
||||
@update-following-calendar-data="updateFollowingCalendarData" />
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
@@ -97,6 +98,7 @@
|
||||
:event="event"
|
||||
mode="grid"
|
||||
:is-following="isEventFollowing(event.id)"
|
||||
@update-following-calendar-data="updateFollowingCalendarData"
|
||||
card-class="grid-card" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -348,6 +350,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
function updateFollowingCalendarData(updatedEvent) {
|
||||
const index = followingCalendar.value.findIndex((item) => item.id === updatedEvent.id);
|
||||
if (index !== -1) {
|
||||
followingCalendar.value.splice(index, 1);
|
||||
}
|
||||
if (updatedEvent.userInterest?.isFollowing) {
|
||||
followingCalendar.value.push(updatedEvent);
|
||||
}
|
||||
}
|
||||
|
||||
function isEventFollowing(eventId) {
|
||||
return followingCalendar.value.some((item) => item.id === eventId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user