|
@@ -1,4 +1,4 @@
|
|
|
-import { useState, useRef } from 'react';
|
|
|
+import { useState, useRef, useEffect } from 'react';
|
|
|
import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
|
|
|
import {gql, urlUpload, actionPromise, actionGoodCard, getGoods, updateImgAction, actionUserUpdate} from "../reducers";
|
|
|
import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
|
|
@@ -11,8 +11,11 @@ const UpdateForm = ({updateImg, updateUser, id}) => {
|
|
|
const [login, changeLogin] = useState(null);
|
|
|
const [password, changePassword] = useState(null);
|
|
|
const [password2, changePassword2] = useState(null);
|
|
|
- const [isUpdateImg, changeImg] = useState(false)
|
|
|
-
|
|
|
+ const [isUpdateImg, changeImg] = useState(false);
|
|
|
+ const [isUpdatePage, changePage] = useState(false);
|
|
|
+
|
|
|
+ useEffect(() => isUpdatePage && window.location.reload()[isUpdatePage])
|
|
|
+ console.log(formRef);
|
|
|
|
|
|
return(
|
|
|
<>
|
|
@@ -51,7 +54,9 @@ const UpdateForm = ({updateImg, updateUser, id}) => {
|
|
|
url:"est"
|
|
|
}
|
|
|
}
|
|
|
- updateUser(newUser)
|
|
|
+ updateUser(newUser);
|
|
|
+ changePage(true);
|
|
|
+
|
|
|
|
|
|
}}>Зберегти</button>
|
|
|
</div>
|