Skip to content

Commit 033e78c

Browse files
authored
improve analytics flag (#58957)
1 parent 57fb879 commit 033e78c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/events/components/events.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ function flushQueue() {
167167
eventQueue = []
168168

169169
try {
170-
navigator.sendBeacon(endpoint, new Blob([eventsBody], { type: 'application/json' }))
170+
if (ANALYTICS_ENABLED) {
171+
navigator.sendBeacon(endpoint, new Blob([eventsBody], { type: 'application/json' }))
172+
}
171173
} catch (err) {
172174
console.warn(`sendBeacon to '${endpoint}' failed.`, err)
173175
}

0 commit comments

Comments
 (0)