Skip to content

Commit

Permalink
fix(WWP-3314): settings link
Browse files Browse the repository at this point in the history
  • Loading branch information
kamenboev committed Jan 24, 2024
1 parent c62919b commit beb06c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/consent/__tests__/consent-settings-link.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ describe('ConsentSettingsLink', () => {
ccpa: {
loadPrivacyManagerModal: expectedFunction,
},
usnat: {
loadPrivacyManagerModal: expectedFunction,
},
};
(global as any).window._sp_ = sp;
(global as any).window._sp_usnat = {
loadPrivacyManagerModal: expectedFunction,
};
});

afterEach(() => {
Expand Down
8 changes: 5 additions & 3 deletions src/consent/consent-settings-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ type SPWindowUnifiedCCPA = Window & {
};

type SPWindowUnifiedUSNAT = Window & {
_sp_usnat?: {
loadPrivacyManagerModal: (managerId: string) => void;
_sp_?: {
usnat?: {
loadPrivacyManagerModal: (managerId: string) => void;
};
};
};

Expand Down Expand Up @@ -75,7 +77,7 @@ export const ConsentSettingsLink: React.FC<ConsentSettingsLinkProps> = ({
);
} else if (usnat) {
// eslint-disable-next-line no-underscore-dangle
(window as SPWindowUnifiedUSNAT)._sp_usnat!.loadPrivacyManagerModal(
(window as SPWindowUnifiedUSNAT)._sp_!.usnat!.loadPrivacyManagerModal(
privacyManagerId,
);
} else {
Expand Down

0 comments on commit beb06c2

Please sign in to comment.