fixed_issues

parent 37f2f0b4
......@@ -42,5 +42,5 @@ hermesEnabled=true
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=midwife
MYAPP_UPLOAD_KEY_PASSWORD=midwife
\ No newline at end of file
MYAPP_UPLOAD_STORE_PASSWORD=password
MYAPP_UPLOAD_KEY_PASSWORD=password
\ No newline at end of file
......@@ -68,10 +68,10 @@ function ExerciseNavigator() {
<>
<Stack.Screen name={ROUTES.EXERCISE_WELCOME} component={WelcomeExercise} key="ExerciseWelcome" />
<Stack.Screen name={ROUTES.EXERCISE_FORM} component={HealthFormExercise} key="ExerciseForm" />
<Stack.Screen name={ROUTES.EXERCISE_MAIN_NEW_MENU} component={MainMenuExercise} key="MainMenuNewExercise" />
<Stack.Screen name={ROUTES.EXERCISE_NEW_VIEW} component={ExerciseView} key="ExerciseNewView" />
<Stack.Screen name={ROUTES.EXERCISE_NEW_ACTION_VIEW} component={ExerciseActionView} key="ExerciseActionNewView" />
<Stack.Screen name={ROUTES.EXERCISE_NEW_PROGRESS} component={ExercisesProgress} key="ExercisesNewProgress" />
<Stack.Screen name={ROUTES.EXERCISE_MAIN_MENU} component={MainMenuExercise} key="MainMenuExercise" />
<Stack.Screen name={ROUTES.EXERCISE_VIEW} component={ExerciseView} key="ExerciseView" />
<Stack.Screen name={ROUTES.EXERCISE_ACTION_VIEW} component={ExerciseActionView} key="ExerciseActionView" />
<Stack.Screen name={ROUTES.EXERCISE_PROGRESS} component={ExercisesProgress} key="ExercisesProgress" />
</>
)}
</Stack.Navigator>
......
......@@ -26,11 +26,9 @@ const HealthFormExercise = (props) => {
useEffect(() => {
if (isWearbleDevice) {
// Reference to your Firebase Realtime Database
const databaseRef = database().ref('test');
ToastAndroid.show('Data reading on device !', ToastAndroid.SHORT);
// Attach an asynchronous listener to read the data at our reference
const onDataChange = (snapshot) => {
const data = snapshot.val();
setDataArray(data);
......@@ -40,7 +38,6 @@ const HealthFormExercise = (props) => {
databaseRef.on('value', onDataChange);
// Detach the listener when component unmounts or when isWearableDevice changes
return () => {
databaseRef.off('value', onDataChange);
};
......@@ -75,7 +72,7 @@ const HealthFormExercise = (props) => {
if (responds.data) {
try {
await AsyncStorage.setItem('userData', JSON.stringify(userData));
navigation.navigate(ROUTES.EXERCISE_MAIN_NEW_MENU)
navigation.navigate(ROUTES.EXERCISE_MAIN_MENU);
ToastAndroid.show('userData updated successfully !', ToastAndroid.SHORT);
} catch (error) {
ToastAndroid.show('Error updating userData !', ToastAndroid.SHORT);
......
import React, { useState, useRef, useEffect } from 'react';
import React, { useState, useRef, useEffect,useCallback } from 'react';
import {
FlatList,
SafeAreaView,
......@@ -20,6 +20,8 @@ import { Cloudinary } from "@cloudinary/url-gen";
import { getAllExerciseDay } from '../../../services/exercises/index';
import AsyncStorage from '@react-native-async-storage/async-storage';
const moment = require('moment');
import { useFocusEffect } from '@react-navigation/native';
const Item = ({ item, onPress, backgroundColor, textColor }) => (
<TouchableOpacity onPress={onPress} style={[styles.item, { backgroundColor, flexDirection: "row", width: '100%' }]}>
......@@ -138,10 +140,31 @@ const MainMenuExercise = (props) => {
}
// useEffect(() => {
// retriveExerciseList()
// setSelectedId(null)
// }, [])
useEffect(() => {
retriveExerciseList()
// Initial check when component mounts
retriveExerciseList();
setSelectedId(null)
}, []);
useFocusEffect(
useCallback(() => {
const checkStatus = async () => {
await retriveExerciseList();
setSelectedId(null)
};
checkStatus();
return () => {
// Cleanup if necessary
};
}, [])
);
return (
<SafeAreaView style={styles.container}>
......
......@@ -45,7 +45,7 @@ const QuestionInEnglishPage = ({navigation, route}) => {
const loadData = () => {
axios
.get('http://emidwife-api.onrender.com/api/quiz/all_english')
.get('http://16.171.16.144/api/quiz/all_english')
.then(response => {
setQuestions(response.data.data);
setIsLoading(false);
......
......@@ -45,7 +45,7 @@ const QuestionInSinhalaPage = ({navigation, route}) => {
const loadData = () => {
axios
.get('http://emidwife-api.onrender.com/api/quiz/all_sinhala')
.get('http://16.171.16.144/api/quiz/all_sinhala')
.then(response => {
setQuestions(response.data.data);
setIsLoading(false);
......
......@@ -156,7 +156,7 @@ const Additionalinformation = ({ navigation }) => {
</View>
<View style={styles.qrCodeBox}>
<Image
source={require('./skinassets/Vectorw.png')} // Make sure the path is correct
source={require('./skinassets/Vectorw.jpg')} // Make sure the path is correct
style={styles.qrCodeImage1}
/>
<Text style={styles.dscriptionText}>
......
import axios from 'axios';
const BASE_PATH = 'https://emidwife-api.onrender.com/api/mother';
const BASE_PATH = 'http://16.171.16.144/api/mother';
import AsyncStorage from '@react-native-async-storage/async-storage';
//signIn API Call
......
import axios from "axios";
let BASE_PATH = 'http://16.170.242.186:8080';
let BASE_PATH2 = 'https://emidwife-api.onrender.com/api/mother';
let BASE_PATH2 = 'http://16.171.16.144/api/mother';
import AsyncStorage from '@react-native-async-storage/async-storage';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment