diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2020-11-21 19:20:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-21 19:20:11 -0500 |
| commit | f620102190629e0b6f180d3ce056d850b1db5aaa (patch) | |
| tree | a96a865b2f2d9c6dcd333b4390c01f48291ccad2 /src/services/SocialLinkingService.ts | |
| parent | 3214fc765cbce3c6f9092546424249d08622afb1 (diff) | |
[TMA-356] Updated icons (#118)
* updated icons
* added small icons
* fixed a bug
* now using the correct assets, fixed a bug
Diffstat (limited to 'src/services/SocialLinkingService.ts')
| -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); |
