mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
fixes: #33968
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
(cherry picked from commit 34f090143c)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user