From f620102190629e0b6f180d3ce056d850b1db5aaa Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Sat, 21 Nov 2020 19:20:11 -0500 Subject: [TMA-356] Updated icons (#118) * updated icons * added small icons * fixed a bug * now using the correct assets, fixed a bug --- src/services/SocialLinkingService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/services/SocialLinkingService.ts') 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 = 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); -- cgit v1.2.3-70-g09d2