fixed calendar not showing events on phone

This commit is contained in:
ivic00
2024-12-09 19:15:29 +01:00
parent 3fe46f1954
commit 2740907d63

View File

@ -22,6 +22,8 @@ import {useSyncEvents} from "@/hooks/useSyncOnScroll";
import {colorMap} from "@/constants/colorMap";
import {useGetFamilyMembers} from "@/hooks/firebase/useGetFamilyMembers";
import CachedImage from "expo-cached-image";
import { DeviceType } from "expo-device";
import * as Device from "expo-device"
interface EventCalendarProps {
calendarHeight: number;
@ -494,7 +496,7 @@ export const EventCalendar: React.FC<EventCalendarProps> = React.memo(
let eventsToFilter = events;
if (selectedUser) {
if (selectedUser && Device.deviceType === DeviceType.TABLET) {
eventsToFilter = events?.filter(event =>
event.attendees?.includes(selectedUser.uid) ||
event.creatorId === selectedUser.uid