Skip to content

Commit

Permalink
fix: order of hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Jul 11, 2024
1 parent bf52ce3 commit 976b1a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/GdprPrivacyManager/GdprPrivacyManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import GdprPrivacyManagerIncludeComponents from './GdprPrivacyManagerIncludeComp
const GdprPrivacyManager = () => {
const location = useLocation();
const isCmsUI = isCmsUi(location.pathname);
const cookies = new GDPRCookies();
usePanelConfigAndPreferences(cookies); //to init data from panel

if (isCmsUI || isPageSpeedBot()) {
return <></>;
}

const cookies = new GDPRCookies();
usePanelConfigAndPreferences(cookies); //to init data from panel

return (
<>
<ShowGdprBanner />
Expand Down
1 change: 1 addition & 0 deletions src/helpers/usePanelConfigAndPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import config from '@plone/volto/registry';

const usePanelConfigAndPreferences = (cookies, forceLoad) => {
// BBB for sites that had the old version with hardcoded panelConfig

const hasOldStyleConfig =
!!config.settings['volto-gdpr-privacy']?.defaultPanelConfig;
const oldStylePanelConfig = useMemo(() => {
Expand Down

0 comments on commit 976b1a5

Please sign in to comment.