From b52c9cb74fd62ffbeff04a0e2170e9ce567f17e0 Mon Sep 17 00:00:00 2001 From: Dejan Date: Fri, 1 Nov 2024 01:23:28 +0100 Subject: [PATCH] - Redesigned the calendar settings page and connecting, disconnecting and syncing calendars, fixed issues with syncing --- .../pages/settings/CalendarSettingsPage.tsx | 351 ++++++++---------- 1 file changed, 151 insertions(+), 200 deletions(-) diff --git a/components/pages/settings/CalendarSettingsPage.tsx b/components/pages/settings/CalendarSettingsPage.tsx index 4fe4dfd..fcceced 100644 --- a/components/pages/settings/CalendarSettingsPage.tsx +++ b/components/pages/settings/CalendarSettingsPage.tsx @@ -22,6 +22,7 @@ import {useAtom} from "jotai"; import {settingsPageIndex} from "../calendar/atoms"; import CalendarSettingsDialog from "./calendar_components/CalendarSettingsDialog"; import {useClearTokens} from "@/hooks/firebase/useClearTokens"; +import Feather from "@expo/vector-icons/Feather"; const googleConfig = { androidClientId: @@ -81,7 +82,7 @@ const CalendarSettingsPage = () => { }; const handleConfirm = () => { - clearToken(selectedService, selectedEmail); + clearTokens({ provider : selectedService, email: selectedEmail }); setModalVisible(false); }; @@ -97,7 +98,7 @@ const CalendarSettingsPage = () => { ); const {mutateAsync: updateUserData} = useUpdateUserData(); - const {mutateAsync: clearToken} = useClearTokens(); + const {mutateAsync: clearTokens} = useClearTokens(); const {mutateAsync: fetchAndSaveGoogleEvents, isLoading: isSyncingGoogle} = useFetchAndSaveGoogleEvents(); const { @@ -477,34 +478,6 @@ const CalendarSettingsPage = () => { color="black" text70BL /> - {profileData?.googleAccounts - ? Object.keys(profileData?.googleAccounts)?.map((googleMail) => { - const googleToken = profileData?.googleAccounts?.[googleMail]?.accessToken; - return ( - googleToken && ( -