Skip to content

Commit

Permalink
πŸ› fix tpv asynchronous submit
Browse files Browse the repository at this point in the history
Co-authored-by: Joana Figueira <[email protected]>
Co-authored-by: Marite Guerrieri <[email protected]>
  • Loading branch information
3 people committed Dec 4, 2024
1 parent 809e289 commit 0595684
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/containers/Member.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ const Member = (props) => {
const [completed, setCompleted] = useState(false)
const [error, setError] = useState(false)
const [data, setData] = useState()
const [url, setUrl] = useState('')

useEffect(() => {
if (url !== '') {
formTPV.current.submit()
}
}, [url])

const handlers = {
SAMPLE_DATA: () => {
Expand Down Expand Up @@ -285,7 +292,7 @@ const Member = (props) => {
trackSucces()
if (response?.data?.endpoint) {
setData(response?.data)
formTPV.current.submit()
setUrl(response.data.endpoint)
} else {
setCompleted(true)
}
Expand Down

0 comments on commit 0595684

Please sign in to comment.