fix(window): unavailable localStorage and sessionStorage (#25599)

This commit is contained in:
Fabien
2023-10-11 19:31:30 +02:00
committed by GitHub
parent f556ef53f3
commit b97f8f03ac
5 changed files with 123 additions and 76 deletions

View File

@@ -336,7 +336,11 @@ export default function DataSourcePanel({
);
const showInfoboxCheck = () => {
if (sessionStorage.getItem('showInfobox') === 'false') return false;
try {
if (sessionStorage.getItem('showInfobox') === 'false') return false;
} catch (error) {
// continue regardless of error
}
return true;
};
@@ -366,7 +370,13 @@ export default function DataSourcePanel({
<StyledInfoboxWrapper>
<Alert
closable
onClose={() => sessionStorage.setItem('showInfobox', 'false')}
onClose={() => {
try {
sessionStorage.setItem('showInfobox', 'false');
} catch (error) {
// continue regardless of error
}
}}
type="info"
message=""
description={