reset error in error dialog (#34203)
fixes: #33968 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
af1a5ea2a8
commit
34f090143c
2 changed files with 8 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
import {
|
||||
useErrorBoundary,
|
||||
type FallbackProps,
|
||||
} from "@keycloak/keycloak-ui-shared";
|
||||
import {
|
||||
Alert,
|
||||
AlertActionCloseButton,
|
||||
|
@ -7,10 +11,9 @@ import {
|
|||
} from "@patternfly/react-core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { type FallbackProps } from "@keycloak/keycloak-ui-shared";
|
||||
|
||||
export const ErrorRenderer = ({ error }: FallbackProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { showBoundary } = useErrorBoundary();
|
||||
|
||||
const reset = () => {
|
||||
window.location.href = window.location.origin + window.location.pathname;
|
||||
|
@ -26,7 +29,9 @@ export const ErrorRenderer = ({ error }: FallbackProps) => {
|
|||
<AlertActionCloseButton title={error.message} onClose={reset} />
|
||||
}
|
||||
actionLinks={
|
||||
<AlertActionLink onClick={reset}>{t("retry")}</AlertActionLink>
|
||||
<AlertActionLink onClick={() => showBoundary()}>
|
||||
{t("retry")}
|
||||
</AlertActionLink>
|
||||
}
|
||||
></Alert>
|
||||
</PageSection>
|
||||
|
|
|
@ -26,7 +26,6 @@ export function useFetch<T>(
|
|||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
const { signal } = controller;
|
||||
showBoundary();
|
||||
adminClientCall()
|
||||
.then((result) => {
|
||||
if (!signal.aborted) {
|
||||
|
|
Loading…
Reference in a new issue