Merge pull request #15088 from overleaf/tm-fix-writefull-analytics

Fix writefull logic so promo-prompt is not sent if not shown

GitOrigin-RevId: c08ae63c269ee30aaf4c831fdf46d170df3d45f3
This commit is contained in:
Thomas 2023-10-04 15:30:47 +02:00 committed by Copybot
parent 872904d73e
commit f1f6007cbc

View file

@ -50,7 +50,7 @@ function UserNotifications() {
// Temporary workaround to prevent also showing groups/enterprise banner
const [showWritefull, setShowWritefull] = useState(() => {
if (isChromium()) {
if (isChromium() && !showBackToSchoolModal) {
const show =
getMeta('ol-showWritefullPromoBanner') &&
!customLocalStorage.getItem('has_dismissed_writefull_promo_banner')
@ -93,17 +93,14 @@ function UserNotifications() {
splitTestName={inrGeoBannerSplitTestName}
/>
) : null}
{showBackToSchoolModal ? (
<BackToSchoolModal />
) : (
<WritefullPromoBanner
show={showWritefull}
setShow={setShowWritefull}
onDismiss={() => {
setDismissedWritefull(true)
}}
/>
)}
{showBackToSchoolModal && <BackToSchoolModal />}
<WritefullPromoBanner
show={showWritefull}
setShow={setShowWritefull}
onDismiss={() => {
setDismissedWritefull(true)
}}
/>
</ul>
</div>
)