message: fixed refresh after delete
diff: -import React, { useState, useEffect } from "react";
  +import React, { useState } from "react";
  +import { Link, useHistory, useParams, useRouteMatch } from "react-router-dom";
  import { useTranslation } from "react-i18next";
  import {
  AlertVariant,
  @@ -6,45 +7,38 @@ import {
  ButtonVariant,
  ToolbarItem,
  } from "@patternfly/react-core";
  +
  import ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation";
  -import { useErrorHandler } from "react-error-boundary";
  import { KeycloakDataTable } from "../../../components/table-toolbar/KeycloakDataTable";
  import { ListEmptyState } from "../../../components/list-empty-state/ListEmptyState";
  import { useAlerts } from "../../../components/alert/Alerts";
  -import {
  - useAdminClient,
  - asyncStateFetch,
  -} from "../../../context/auth/AdminClient";
  -import { Link, useHistory, useParams, useRouteMatch } from "react-router-dom";
  +import { useAdminClient } from "../../../context/auth/AdminClient";
  import { useConfirmDialog } from "../../../components/confirm-dialog/ConfirmDialog";
  export const LdapMapperList = () => {
  - const [mappers, setMappers] = useState<ComponentRepresentation[]>();
  const history = useHistory();
  const { t } = useTranslation("user-federation");
  const adminClient = useAdminClient();
  const { addAlert } = useAlerts();
  const { url } = useRouteMatch();
  - const handleError = useErrorHandler();
  const [key, setKey] = useState(0);
  -
  const refresh = () => setKey(new Date().getTime());
  +
  const { id } = useParams<{ id: string }>();
  const [selectedMapper, setSelectedMapper] = useState<
  ComponentRepresentation
  >();
  - const loader = async () =>
  - Promise.resolve(
  - (mappers || []).map((mapper) => {
  - return {
  - ...mapper,
  - name: mapper.name,
  - type: mapper.providerId,
  - } as ComponentRepresentation;
  - })
  - );
  + const loader = async () => {
  + const testParams: {
  + [name: string]: string | number;
  + } = {
  + parent: id,
  + type: "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
  + };
  + return adminClient.components.find(testParams);
  + };
  const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
  titleKey: t("common:deleteMappingTitle", { mapperId: selectedMapper?.id }),
  @@ -68,39 +62,6 @@ export const LdapMapperList = () => {
  },
  });
  - useEffect(() => {
  - return asyncStateFetch(
  - () => {
  - const testParams: {
  - [name: string]: string | number;
  - } = {
  - parent: id,
  - type: "org.keycloak.storage.ldap.mappers.LDAPStorageMapper",
  - };
  - return adminClient.components.find(testParams);
  - },
  - (mappers) => {
  - setMappers(mappers);
  - // TODO: remove after debugging
  - console.log("LdapMapperList - setMappers being set with:");
  - console.log(mappers);
  - },
  - handleError
  - );
  - }, [key]);
  -
  - if (!mappers) {
  - return (
  - <>
  - <ListEmptyState
  - message={t("common:emptyMappers")}
  - instructions={t("common:emptyMappersInstructions")}
  - primaryActionText={t("common:emptyPrimaryAction")}
  - />
  - </>
  - );
  - }
  -
  const getUrl = (url: string) => {
  if (url.indexOf("/mappers") === -1) {
  return `${url}/mappers`;
  