From c490a02c722de54a804487fdb96c9ffea363860a Mon Sep 17 00:00:00 2001 From: Lucas Schoenfelder <les17@inf.ufpr.br> Date: Thu, 10 Dec 2020 11:13:44 -0300 Subject: [PATCH] added feature to keep user info in case of an error --- src/Components/SignUpContainerFunction.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Components/SignUpContainerFunction.js b/src/Components/SignUpContainerFunction.js index 7f49992a..e12dd149 100644 --- a/src/Components/SignUpContainerFunction.js +++ b/src/Components/SignUpContainerFunction.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, {useState} from "react"; +import React, {useState, useEffect} from "react"; import GoogleLogin from 'react-google-login' import { Button } from '@material-ui/core'; //import FacebookLogin from 'react-facebook-login'; @@ -121,10 +121,15 @@ export default function SignUpContainer (props) { if (!(formNome.key || formEmail.key || formSenha.key)) { props.handleLoginInfo(newLogin) - limpaCamposForm() + } } + useEffect(() => { + limpaCamposForm() + }, [props.triggerLimpaCamposForm] + ) + return ( <ContainerStyled > <DialogHeaderStyled> -- GitLab