Skip to content

Commit

Permalink
fix: fix request load error
Browse files Browse the repository at this point in the history
  • Loading branch information
geeekgod committed Oct 7, 2022
1 parent edf310b commit 1d0a397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"versionCode": 2
"versionCode": 3
},
"web": {
"favicon": "./assets/favicon.png"
Expand Down
9 changes: 6 additions & 3 deletions app/screens/PostRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AntDesign, Fontisto, MaterialIcons, Entypo, FontAwesome5 } from '@expo/
import { AuthContext } from '../../context/AuthContext';
import * as Location from 'expo-location';
import bloodLineApi from '../../api';
import { DataContext } from '../../context/DataContext';

const bloodGroups = [
{
Expand Down Expand Up @@ -45,7 +46,8 @@ const bloodGroups = [

const PostRequest = ({ navigation }) => {

const { accessToken } = useContext(AuthContext)
const { accessToken, getUser } = useContext(AuthContext)
const { getRequest } = useContext(DataContext)

const [location, setLocation] = useState(null);
const [errorMsg, setErrorMsg] = useState(null);
Expand Down Expand Up @@ -165,11 +167,11 @@ const PostRequest = ({ navigation }) => {
...data,
headers, withCredentials: true
}).then((res) => {
if (res.data & res.data.success) {
if (res.data.success) {
reset();
setSubmitted(false)
getUser(accessToken);
getRequest(accessToken)
setSubmitted(false)
navigation.navigate("Home")
}
}).catch((err) => {
Expand Down Expand Up @@ -279,6 +281,7 @@ const PostRequest = ({ navigation }) => {
pl='6'
pr='6'
fontSize='xl'
opacity={submitted ? 50 : 100}
rounded='2xl'
onPress={() => {
setSubmitted(true)
Expand Down

0 comments on commit 1d0a397

Please sign in to comment.