fixed_issues

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