Merge pull request #18744 from overleaf/jpa-ce-no-events

[web] avoid sending events in Server Pro/CE

GitOrigin-RevId: 04d2fa7939c448bc00757c5015e22a46b6b07bb5
This commit is contained in:
Brian Gough 2024-06-19 11:26:49 +01:00 committed by Copybot
parent d43292cfe6
commit be23b7e73b
2 changed files with 4 additions and 0 deletions

View file

@ -68,6 +68,7 @@ export const isSmallDevice = window.screen.width < 768
function sendBeacon(key, data) {
if (!navigator || !navigator.sendBeacon) return
if (!getMeta('ol-ExposedSettings').isOverleaf) return
data._csrf = getMeta('ol-csrfToken')
const blob = new Blob([JSON.stringify(data)], {

View file

@ -1,4 +1,5 @@
import StartFreeTrialButton from '../../../../frontend/js/shared/components/start-free-trial-button'
import getMeta from '@/utils/meta'
describe('start free trial button', function () {
beforeEach(function () {
@ -8,6 +9,8 @@ describe('start free trial button', function () {
cy.intercept('POST', '/event/paywall-click', {
statusCode: 204,
}).as('event-paywall-click')
getMeta('ol-ExposedSettings').isOverleaf = true
})
it('renders the button with default text', function () {