|
@@ -1,8 +1,8 @@
|
|
-import React from 'react';
|
|
|
|
|
|
+import React, { useCallback, useState } from 'react';
|
|
import { View, ScrollView } from 'react-native';
|
|
import { View, ScrollView } from 'react-native';
|
|
import { Formik } from 'formik';
|
|
import { Formik } from 'formik';
|
|
import * as yup from 'yup';
|
|
import * as yup from 'yup';
|
|
-import { CommonActions, useNavigation } from '@react-navigation/native';
|
|
|
|
|
|
+import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
|
|
|
|
import { AvatarPicker, BigText, Button, Header, Input, PageWrapper } from '../../../components';
|
|
import { AvatarPicker, BigText, Button, Header, Input, PageWrapper } from '../../../components';
|
|
@@ -30,6 +30,21 @@ const EditAccount = () => {
|
|
const [user] = store((state) => [state.registration.user]);
|
|
const [user] = store((state) => [state.registration.user]);
|
|
|
|
|
|
const { data, error, mutate: userRegister } = useRegisterMutation();
|
|
const { data, error, mutate: userRegister } = useRegisterMutation();
|
|
|
|
+ const [isLoading, setIsLoading] = useState(true);
|
|
|
|
+
|
|
|
|
+ useFocusEffect(
|
|
|
|
+ useCallback(() => {
|
|
|
|
+ const fetchData = async () => {
|
|
|
|
+ setIsLoading(false);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ fetchData();
|
|
|
|
+ }, [])
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if (isLoading) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
if (data.token) {
|
|
if (data.token) {
|