diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/SocialLinkingService.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/services/SocialLinkingService.ts b/src/services/SocialLinkingService.ts index c9ffcedf..4a01ee50 100644 --- a/src/services/SocialLinkingService.ts +++ b/src/services/SocialLinkingService.ts @@ -170,6 +170,8 @@ export const handlePressForAuthBrowser: ( } Alert.alert(`Successfully linked ${socialType} 🎉`); return true; + } else if (response.type === 'cancel') { + return false; } else { throw 'Error from Oauth API'; } @@ -200,11 +202,10 @@ export const getLinkedSocials: (user_id: string) => Promise<string[]> = async ( Authorization: 'Token ' + user_token, }, }); - const body = await response.json(); if (response.status !== 200) { - console.log(body); - throw 'Unable to fetch from server'; + throw 'Unable to fetch linked socials from server'; } + const body = await response.json(); return body.linked_socials || []; } catch (error) { console.log(error); |
