sync update

This commit is contained in:
Milan Paunovic
2024-11-02 22:27:17 +01:00
parent 8a0370933d
commit f1b0bcd32d
6 changed files with 221 additions and 118 deletions

View File

@ -17,20 +17,23 @@ export const useClearTokens = () => {
if (provider === "google") {
let googleAccounts = profileData?.googleAccounts;
if (googleAccounts) {
googleAccounts[email] = null;
newUserData.googleAccounts = googleAccounts;
const newGoogleAccounts = {...googleAccounts}
delete newGoogleAccounts[email];
newUserData.googleAccounts = newGoogleAccounts;
}
} else if (provider === "outlook") {
let microsoftAccounts = profileData?.microsoftAccounts;
if (microsoftAccounts) {
microsoftAccounts[email] = null;
newUserData.microsoftAccounts = microsoftAccounts;
const newMicrosoftAccounts = {...microsoftAccounts}
delete microsoftAccounts[email];
newUserData.microsoftAccounts = newMicrosoftAccounts;
}
} else if (provider === "apple") {
let appleAccounts = profileData?.appleAccounts;
if (appleAccounts) {
appleAccounts[email] = null;
newUserData.appleAccounts = appleAccounts;
const newAppleAccounts = {...appleAccounts}
delete newAppleAccounts[email];
newUserData.appleAccounts = newAppleAccounts;
}
}
await updateUserData({newUserData});