fix configuration page on safari w/ jasquat

This commit is contained in:
burnettk 2023-05-08 16:13:30 -04:00
parent 5a51cc9b18
commit 339745b6a8

View File

@ -23,10 +23,11 @@ export default function Configuration() {
[targetUris.authenticationListPath]: ['GET'],
[targetUris.secretListPath]: ['GET'],
};
const { ability } = usePermissionFetcher(permissionRequestData);
const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData
);
useEffect(() => {
console.log('Configuration remove error');
removeError();
let newSelectedTabIndex = 0;
if (location.pathname.match(/^\/admin\/configuration\/authentications\b/)) {
@ -35,6 +36,13 @@ export default function Configuration() {
setSelectedTabIndex(newSelectedTabIndex);
}, [location, removeError]);
// wow, if you do not check to see if the permissions are loaded, then in safari,
// you will get {null} inside the <TabList> which totally explodes carbon (in safari!).
// we *think* that null inside a TabList works fine in all other browsers.
if (!permissionsLoaded) {
return null;
}
return (
<>
<Tabs selectedIndex={selectedTabIndex}>