diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/friends/InviteFriendTile.tsx | 28 | ||||
-rw-r--r-- | src/constants/api.ts | 3 |
2 files changed, 18 insertions, 13 deletions
diff --git a/src/components/friends/InviteFriendTile.tsx b/src/components/friends/InviteFriendTile.tsx index abd017d0..355b88e8 100644 --- a/src/components/friends/InviteFriendTile.tsx +++ b/src/components/friends/InviteFriendTile.tsx @@ -46,22 +46,26 @@ const InviteFriendTile: React.FC<InviteFriendTileProps> = ({item}) => { { text: 'Yes!', onPress: async () => { - setInvited(true); - const inviteCode = await handleCreateInviteCode(); - await inviteFriendService( + const success = await inviteFriendService( item.phoneNumber, item.firstName, item.lastName, ); - Linking.openURL( - `sms:${item.phoneNumber}&body=${INVITE_USER_SMS_BODY( - item.firstName, - name, - inviteCode, - )}`, - ); - if (invites_left === 1) { - Alert.alert(SUCCESS_LAST_CONTACT_INVITE); + if (success) { + const inviteCode = await handleCreateInviteCode(); + setInvited(true); + Linking.openURL( + `sms:${item.phoneNumber}&body=${INVITE_USER_SMS_BODY( + item.firstName, + name, + inviteCode, + )}`, + ); + if (invites_left === 1) { + Alert.alert(SUCCESS_LAST_CONTACT_INVITE); + } + } else { + Alert.alert(ERROR_SOMETHING_WENT_WRONG); } }, }, diff --git a/src/constants/api.ts b/src/constants/api.ts index 3c7e669e..ec67b6f9 100644 --- a/src/constants/api.ts +++ b/src/constants/api.ts @@ -5,7 +5,8 @@ const BASE_URL: string = 'http://127.0.0.1:8000/'; export const STREAM_CHAT_API = 'g2hvnyqx9cmv'; // Prod -// const BASE_URL: string = 'http://app-prod.tagg.id/'; +// const BASE_URL: string = 'https://app-prod2.tagg.id/'; +// const BASE_URL: string = 'https://app-prod3.tagg.id/'; // export const STREAM_CHAT_API = 'ur3kg5qz8x5v' const API_URL: string = BASE_URL + 'api/'; |