From d7d63e0f51430877fdceae2682da4ba27e4b65ef Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 8 Apr 2024 11:09:22 +0200 Subject: [PATCH] Merge pull request #17693 from overleaf/msm-hide-grammarly-sp Prevent grammarly ad from rendering in CE/SP GitOrigin-RevId: 3ef191f282f2ce682236710df9ca32a087271c4c --- .../features/source-editor/components/grammarly-advert.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx b/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx index 765cc7a3bf..3a1d44934c 100644 --- a/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx +++ b/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx @@ -6,8 +6,12 @@ import useRemindMeLater from '@/shared/hooks/use-remind-me-later' import GrammarlyLogo from '@/shared/svgs/grammarly-logo' import * as eventTracking from '../../../infrastructure/event-tracking' import useWaitForGrammarlyCheck from '@/shared/hooks/use-wait-for-grammarly-check' +import getMeta from '@/utils/meta' +import { ExposedSettings } from '../../../../../types/exposed-settings' export default function GrammarlyAdvert() { + const { isOverleaf } = getMeta('ol-ExposedSettings') as ExposedSettings + const [show, setShow] = useState(false) const { t } = useTranslation() @@ -57,7 +61,7 @@ export default function GrammarlyAdvert() { remindThemLater() }, [remindThemLater]) - if (!show) { + if (!isOverleaf || !show) { return null }