aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-19 15:38:21 -0400
committerGitHub <noreply@github.com>2021-03-19 15:38:21 -0400
commit53e5c331326473ab8649afc94065d2000baaa6db (patch)
treec2147859e8270588749d606fb909110e4461e5fc /src
parent7b4bf7992b562c8140628c48e2cc05c347cb1e01 (diff)
parentb3f9bb5a67b88f04ac1b54293569a4d950f8b8c8 (diff)
Merge pull request #312 from IvanIFChen/hotfox-white-screen-bug-on-invite-friends
[HOTFIX] White screen bug on invite friends when navigating to profile
Diffstat (limited to 'src')
-rw-r--r--src/components/profile/Friends.tsx1
-rw-r--r--src/screens/profile/InviteFriendsScreen.tsx16
2 files changed, 10 insertions, 7 deletions
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx
index 51ba6c64..cf354e06 100644
--- a/src/components/profile/Friends.tsx
+++ b/src/components/profile/Friends.tsx
@@ -63,7 +63,6 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
<TouchableOpacity
style={styles.addFriendButton}
onPress={() => {
- console.log('screentype: ', screenType);
handleAddFriend(screenType, profilePreview, dispatch, state).then(
(success) => {
if (success) {
diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx
index d1142b7f..36aa8ada 100644
--- a/src/screens/profile/InviteFriendsScreen.tsx
+++ b/src/screens/profile/InviteFriendsScreen.tsx
@@ -31,15 +31,21 @@ import Animated from 'react-native-reanimated';
import Icon from 'react-native-vector-icons/Feather';
import {InviteFriendTile} from '../../components/friends';
import {TAGG_LIGHT_BLUE} from '../../constants';
+import {MainStackParams} from '../../routes';
+import {RouteProp} from '@react-navigation/native';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
+type InviteFriendsScreenRouteProp = RouteProp<
+ MainStackParams,
+ 'InviteFriendsScreen'
+>;
+
interface InviteFriendsScreenProps {
- screenType: ScreenType;
+ route: InviteFriendsScreenRouteProp;
}
-const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
- screenType,
-}) => {
+const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => {
+ const {screenType} = route.params;
const dispatch = useDispatch();
const state = useStore().getState();
const [usersFromContacts, setUsersFromContacts] = useState<
@@ -64,7 +70,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
let response = await usersFromContactsService(retrievedContacts);
await setUsersFromContacts(response.existing_tagg_users);
await setNonUsersFromContacts(response.invite_from_contacts);
- usersFromContacts.map((user) => console.log('user: ', user.username));
setResults({
usersFromContacts: response.existing_tagg_users,
nonUsersFromContacts: response.invite_from_contacts,
@@ -81,7 +86,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
* Main handler for changes in query.
*/
useEffect(() => {
- console.log('query is now ', query);
const search = async () => {
if (query.length > 0) {
const searchResultsUsers = usersFromContacts.filter(