From b6d7efd8aea3ebafe32b19dcb15a98963bb7a3eb Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:18:36 -0400 Subject: [PATCH] Fix consent modal showing up for currently logged in admin --- src/shared/components/common/adult-consent-modal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/components/common/adult-consent-modal.tsx b/src/shared/components/common/adult-consent-modal.tsx index 4519b502..10ee1f9e 100644 --- a/src/shared/components/common/adult-consent-modal.tsx +++ b/src/shared/components/common/adult-consent-modal.tsx @@ -4,6 +4,7 @@ import { adultConsentLocalStorageKey } from "../../config"; import { setIsoData } from "@utils/app"; import { IsoDataOptionalSite } from "../../interfaces"; import { mdToHtml } from "../../markdown"; +import { UserService } from "../../services"; interface AdultConsentModalProps { contentWarning: string; @@ -95,7 +96,10 @@ export default class AdultConsentModal extends Component< if ( siteRes?.site_view.site.content_warning && - !(siteRes?.my_user || localStorage.getItem(adultConsentLocalStorageKey)) + !( + UserService.Instance.myUserInfo || + localStorage.getItem(adultConsentLocalStorageKey) + ) ) { this.setState({ show: true }); }