Forráskód Böngészése

fixed issue occuring when there are no nearby landmarjs

chase 2 éve
szülő
commit
dcbfe2dbc1
2 módosított fájl, 14 hozzáadás és 2 törlés
  1. 9 2
      src/data/Auth/AuthContext.tsx
  2. 5 0
      src/utils/RequestUtils.ts

+ 9 - 2
src/data/Auth/AuthContext.tsx

@@ -118,12 +118,19 @@ export const AuthContextProvider: React.FC = ({children}) => {
                         authorized: false,
                         errorMessage: 'Failed to retrieve user data from server'})
 
+<<<<<<< HEAD
                     if (response.status == 200) {
+=======
+                    if (response.status === 200) {
+>>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
                         setAccessToken(accessTokenFromStorage)
                         setRefreshToken(await getItemAsync(SECURESTORE_REFRESHTOKEN))
                         setNotificationToken(await getItemAsync(SECURESTORE_NOTIFTOKEN))
                         setUserId(await getItemAsync(SECURESTORE_ID))
+<<<<<<< HEAD
                         setAnonUserId('')
+=======
+>>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
                         return
                     }
                 }
@@ -358,8 +365,6 @@ export const AuthContextProvider: React.FC = ({children}) => {
                     authorized: true,
                     errorMessage: 'Something went wrong when converting anonymous landmarks'
                 })
-
-                setAnonUserId('')
                 
                 setAlert({
                     title: 'Heads up',
@@ -368,6 +373,8 @@ export const AuthContextProvider: React.FC = ({children}) => {
                     type: 'warning'
                 })
             }
+
+            setAnonUserId('')
         } catch (error) {
             reportAxiosError("[Authentication]: Error when checking for anonymous landmarks", error);
             setAlert({

+ 5 - 0
src/utils/RequestUtils.ts

@@ -25,8 +25,13 @@ import Config from 'react-native-config'
 //export const API_URL = 'http://192.168.3.81:8000'
 // export const API_URL = 'https://staging.clicknpush.ca'
 
+<<<<<<< HEAD
 //export const API_URL = 'http://192.168.3.102:8000'   // Chase
 //export const API_URL = 'http://192.168.0.22:8000'       // Eric
 export const API_URL = 'https://app.clicknpush.ca'
+=======
+// export const API_URL = 'http://192.168.3.162:8000'   // Chase
+export const API_URL = 'https://app.clicknpush.ca'       // Eric
+>>>>>>> a21b27df012bca6468d78c33a54c88ef7d8156c9
 
 // export const API_URL = Config.API_URL