From a74bc24d29366917c33aea240a9a71e595d8c55f Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Wed, 21 Apr 2021 15:23:09 -0400
Subject: fixed

---
 src/routes/main/MainStackScreen.tsx | 47 ++++++++++---------------------------
 1 file changed, 12 insertions(+), 35 deletions(-)

(limited to 'src/routes/main/MainStackScreen.tsx')

diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx
index 37867151..f5100e58 100644
--- a/src/routes/main/MainStackScreen.tsx
+++ b/src/routes/main/MainStackScreen.tsx
@@ -1,7 +1,6 @@
-import AsyncStorage from '@react-native-community/async-storage';
 import {RouteProp} from '@react-navigation/native';
 import {StackNavigationOptions} from '@react-navigation/stack';
-import React, {useEffect, useState} from 'react';
+import React from 'react';
 import {StyleSheet, Text} from 'react-native';
 import {normalize} from 'react-native-elements';
 import BackIcon from '../../assets/icons/back-arrow.svg';
@@ -56,28 +55,9 @@ interface MainStackProps {
 const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
   const {screenType} = route.params;
 
-  // const isProfileTab = screenType === ScreenType.Profile;
   const isSearchTab = screenType === ScreenType.Search;
   const isNotificationsTab = screenType === ScreenType.Notifications;
   const isSuggestedPeopleTab = screenType === ScreenType.SuggestedPeople;
-  const [respondedToAccessContacts, setRespondedToAccessContacts] = useState(
-    'true',
-  );
-
-  useEffect(() => {
-    loadResponseToAccessContacts();
-  }, []);
-
-  const loadResponseToAccessContacts = () => {
-    AsyncStorage.getItem('respondedToAccessContacts')
-      .then((value) => {
-        setRespondedToAccessContacts(value ? value : 'false');
-      })
-      .catch((error) => {
-        console.log('Something went wrong', error);
-        setRespondedToAccessContacts('true');
-      });
-  };
 
   const initialRouteName = (() => {
     switch (screenType) {
@@ -131,20 +111,13 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
             ...headerBarOptions('white', ''),
           }}
         />
-        {isSuggestedPeopleTab &&
-          (respondedToAccessContacts && respondedToAccessContacts === 'true' ? (
-            <MainStack.Screen
-              name="SuggestedPeople"
-              component={SuggestedPeopleScreen}
-              initialParams={{screenType}}
-            />
-          ) : (
-            <MainStack.Screen
-              name="SuggestedPeople"
-              component={RequestContactsAccess}
-              initialParams={{screenType}}
-            />
-          ))}
+        {isSuggestedPeopleTab && (
+          <MainStack.Screen
+            name="SuggestedPeople"
+            component={SuggestedPeopleScreen}
+            initialParams={{screenType}}
+          />
+        )}
         {isNotificationsTab && (
           <MainStack.Screen
             name="Notifications"
@@ -271,6 +244,10 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
           name="RequestContactsAccess"
           component={RequestContactsAccess}
           initialParams={{screenType}}
+          options={{
+            ...modalStyle,
+            gestureEnabled: false,
+          }}
         />
         <MainStack.Screen
           name="EditProfile"
-- 
cgit v1.2.3-70-g09d2

