Skip to content

Instantly share code, notes, and snippets.

@shawn-sandy
Last active July 14, 2022 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawn-sandy/40d9b7a4482e129dc0f21d328409b520 to your computer and use it in GitHub Desktop.
Save shawn-sandy/40d9b7a4482e129dc0f21d328409b520 to your computer and use it in GitHub Desktop.
/**
* ! 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