diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2021-01-15 19:27:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 19:27:03 -0500 |
| commit | 1803da7388902db45ad37fbac509604ae632bdb5 (patch) | |
| tree | a786919f9bc42f7797367d55ed8f1e099134f368 /src/services/SocialLinkingService.ts | |
| parent | 4d9efafeb4243e20e1fc936c27b9055c7ec82f8a (diff) | |
| parent | cc52dabaaf529763e9c1c4683ba94ed55c5671a8 (diff) | |
Merge pull request #176 from IvanIFChen/tma498-update-error-strings
[TMA-498] Update Error Strings
Diffstat (limited to 'src/services/SocialLinkingService.ts')
| -rw-r--r-- | src/services/SocialLinkingService.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/services/SocialLinkingService.ts b/src/services/SocialLinkingService.ts index 4a01ee50..1423c8c0 100644 --- a/src/services/SocialLinkingService.ts +++ b/src/services/SocialLinkingService.ts @@ -12,6 +12,8 @@ import { LINK_TWITTER_ENDPOINT, LINK_TWITTER_OAUTH, } from '../constants'; +import {COMING_SOON_MSG, ERROR_LINK, SUCCESS_LINK} from '../constants/strings'; +import {CategorySelection} from '../screens'; // A list of endpoint strings for all the integrated socials export const integratedEndpoints: {[social: string]: [string, string]} = { @@ -124,7 +126,7 @@ export const handlePressForAuthBrowser: ( ) => Promise<boolean> = async (socialType: string) => { try { if (!(socialType in integratedEndpoints)) { - Alert.alert('Coming soon!'); + Alert.alert(COMING_SOON_MSG); return false; } @@ -168,7 +170,7 @@ export const handlePressForAuthBrowser: ( if (!success) { throw 'Unable to register with backend'; } - Alert.alert(`Successfully linked ${socialType} 🎉`); + Alert.alert(SUCCESS_LINK(socialType)); return true; } else if (response.type === 'cancel') { return false; @@ -178,14 +180,12 @@ export const handlePressForAuthBrowser: ( }) .catch((error) => { console.log(error); - Alert.alert( - `Something went wrong, we can't link with ${socialType} 😔`, - ); + Alert.alert(ERROR_LINK(socialType)); return false; }); } catch (error) { console.log(error); - Alert.alert(`Something went wrong, we can't link with ${socialType} 😔`); + Alert.alert(ERROR_LINK(socialType)); } return false; }; |
