Last active
July 14, 2022 15:59
-
-
Save shawn-sandy/40d9b7a4482e129dc0f21d328409b520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ! issues calling onFailure | |
*/ | |
useEffect(() => { | |
if (atsProgressStatus === 'INVALID_CREDENTIALS') { | |
callOnFailure(); | |
next(); | |
// onFailure(); | |
console.log({ atsProgressStatus }); | |
} | |
}, [atsProgressStatus]); | |
const callOnFailure = (): void => { | |
onFailure(); | |
}; | |
/** | |
* ! call from config step works | |
* ! button does not work | |
* ON failure call moved to config step wont work as expected | |
* ! issues calling onFailure | |
*/ | |
const onFailure = (): void => { | |
// setError(true); | |
setModalButtons( | |
<Button type="button" onClick={tryAgain} data-testid={`install-try-again`}> | |
{gt.gettext('Try again')} | |
</Button> | |
); | |
}; | |
useEffect(() => { | |
if (unVerifiedCredentials) { | |
setInProgress(false); | |
onFailure(); | |
} | |
}, [unVerifiedCredentials]); | |
/** | |
* * this call waits on the atsProgressStatus then executes | |
*/ | |
useEffect(() => { | |
if (atsProgressStatus === 'INVALID_CREDENTIALS') { | |
callOnFailure(); | |
setError(true); | |
// next(); | |
console.log({ atsProgressStatus }); | |
} else if (atsProgressStatus === 'PENDING_VALIDATION') { | |
next(); | |
} | |
}, [atsProgressStatus]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment