use the right context (#27237)
fixes: #27234 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
cecce40aa5
commit
d03890263e
1 changed files with 3 additions and 5 deletions
|
@ -8,7 +8,6 @@ import {
|
|||
} from "@patternfly/react-core";
|
||||
import { ExternalLinkSquareAltIcon } from "@patternfly/react-icons";
|
||||
import { TFunction } from "i18next";
|
||||
import { useKeycloak } from "keycloak-masthead";
|
||||
import { useState } from "react";
|
||||
import { ErrorOption, useForm } from "react-hook-form";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
@ -36,7 +35,6 @@ import { usePromise } from "../utils/usePromise";
|
|||
export const PersonalInfo = () => {
|
||||
const { t } = useTranslation();
|
||||
const context = useEnvironment();
|
||||
const keycloak = useKeycloak();
|
||||
const [userProfileMetadata, setUserProfileMetadata] =
|
||||
useState<UserProfileMetadata>();
|
||||
const [supportedLocales, setSupportedLocales] = useState<string[]>([]);
|
||||
|
@ -72,7 +70,7 @@ export const PersonalInfo = () => {
|
|||
console.warn("Error(s) loading locale", locale, error);
|
||||
}
|
||||
});
|
||||
keycloak?.updateToken();
|
||||
context.keycloak.updateToken();
|
||||
addAlert(t("accountUpdatedMessage"));
|
||||
} catch (error) {
|
||||
addError(t("accountUpdatedError").toString());
|
||||
|
@ -116,7 +114,7 @@ export const PersonalInfo = () => {
|
|||
id="update-email-btn"
|
||||
variant="link"
|
||||
onClick={() =>
|
||||
keycloak?.keycloak.login({ action: "UPDATE_EMAIL" })
|
||||
context.keycloak.login({ action: "UPDATE_EMAIL" })
|
||||
}
|
||||
icon={<ExternalLinkSquareAltIcon />}
|
||||
iconPosition="right"
|
||||
|
@ -158,7 +156,7 @@ export const PersonalInfo = () => {
|
|||
id="delete-account-btn"
|
||||
variant="danger"
|
||||
onClick={() =>
|
||||
keycloak?.keycloak.login({
|
||||
context.keycloak.login({
|
||||
action: "delete_account",
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue