mirror of
https://github.com/urosran/cally.git
synced 2026-10-23 09:37:54 +00:00
- Introduced attribute id in the eventData type
- INtroduced new method to save the event data from the google and microsoft providers only if there isn't already an event with the same id
This commit is contained in:
@@ -6,7 +6,7 @@ import { colorMap } from "@/contexts/SettingsContext";
|
||||
import { TouchableOpacity } from "react-native-gesture-handler";
|
||||
import { fetchGoogleCalendarEvents } from "@/calendar-integration/google-calendar-utils";
|
||||
import { fetchMicrosoftCalendarEvents } from "@/calendar-integration/microsoft-calendar-utils";
|
||||
import { useCreateEvent } from "@/hooks/firebase/useCreateEvent";
|
||||
import { useCreateEventFromProvider } from "@/hooks/firebase/useCreateEvent";
|
||||
import { useAuthContext } from "@/contexts/AuthContext";
|
||||
import { useUpdateUserData } from "@/hooks/firebase/useUpdateUserData";
|
||||
import { GoogleSignin } from "@react-native-google-signin/google-signin";
|
||||
@@ -48,7 +48,7 @@ const CalendarSettingsPage = (props: {
|
||||
const [startDate, setStartDate] = useState<boolean>(true);
|
||||
const { profileData } = useAuthContext();
|
||||
|
||||
const { mutateAsync: createEvent } = useCreateEvent();
|
||||
const { mutateAsync: createEventFromProvider } = useCreateEventFromProvider();
|
||||
const { mutateAsync: updateUserData } = useUpdateUserData();
|
||||
|
||||
const fetchAndSaveGoogleEvents = () => {
|
||||
@@ -67,7 +67,7 @@ const CalendarSettingsPage = (props: {
|
||||
};
|
||||
|
||||
async function saveData(item) {
|
||||
await createEvent(item);
|
||||
await createEventFromProvider(item);
|
||||
}
|
||||
|
||||
const fetchAndSaveMicrosoftEvents = () => {
|
||||
|
||||
Reference in New Issue
Block a user