fix: isChildEvent issue + loader is shown forever (#15524)

This commit is contained in:
Alex van Andel authored and GitHub committed 2024-06-21 13:07:46 +00:00
1 parent 89ac9a3d31
commit c2d7054ec4
2 files changed
+8 -5

No files matched your search

@@ -134,9 +134,12 @@ export const getEventTypesByViewer = async (user: User, filters?: Filters, forRo
const userEventTypes = (await Promise.all(profileEventTypes.map(mapEventType))).filter((eventType) => {
const isAChildEvent = eventType.parentId;
if (!isAChildEvent) {
return true;
}
// A child event only has one user
const childEventAssignee = eventType.users[0];
if (isAChildEvent && childEventAssignee.id != user.id) {
if (!childEventAssignee || childEventAssignee.id != user.id) {
return false;
}
return true;