aboutsummaryrefslogtreecommitdiff
path: root/src/services/SocialLinkingService.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-01-11 16:11:11 -0500
committerIvan Chen <ivan@tagg.id>2021-01-15 14:19:50 -0500
commit080e76350c2570eeb096fad40fe95f1b766b4539 (patch)
treebcb9f73f2c192f8c34f2064a5c3fd003756c2823 /src/services/SocialLinkingService.ts
parent1dccfb1d3e9470d81de8d1ec0a0dbb3803372f7d (diff)
created strings.ts and linting
Diffstat (limited to 'src/services/SocialLinkingService.ts')
-rw-r--r--src/services/SocialLinkingService.ts12
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;
};