Skip to content

Commit

Permalink
new message to register successful b00tc4mp#478
Browse files Browse the repository at this point in the history
  • Loading branch information
TanoAlmost committed Apr 18, 2024
1 parent cf959b9 commit aafcfb4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions staff/tano-aleu/project/app/src/pages/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import logo from '../assets/synqple.logo.png';

import versionLogo from '../assets/synqple.logo.version.white.png'

import Context from '../contexts/Context';

function Register(props) {
console.log('Register')

const context = useContext()
const context = useContext(Context)

function handleSubmit(event) {
event.preventDefault()
Expand All @@ -29,7 +31,13 @@ function Register(props) {
try {

logic.registerUser(name, email, password)
.then(() => props.onSuccess())
.then(() => {
context.handleSuccess('User created successfully, you will be automatically redirected to login')
event.target.reset();
setTimeout(() => {
props.onSuccess(); // Esto se ejecutará después de 2 segundos
}, 5000); // 2000 milisegundos = 2 segundos
})
.catch(error => context.handleError(error))

} catch (error) {
Expand Down

0 comments on commit aafcfb4

Please sign in to comment.