fix(tracker): 12 0 2 fix for canvas check

This commit is contained in:
nick-delirium 2024-02-12 11:29:01 +01:00
parent e0dfa21306
commit 1035a1a219
3 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,7 @@
# 12.0.2
- fix for canvas snapshot check
# 12.0.1
- pause canvas snapshotting when its offscreen

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker",
"description": "The OpenReplay tracker main package",
"version": "12.0.1",
"version": "12.0.2",
"keywords": [
"logging",
"replay"

View file

@ -55,7 +55,7 @@ class CanvasRecorder {
entries.forEach((entry) => {
if (entry.isIntersecting) {
if (entry.target) {
if (this.snapshots[id].createdAt) {
if (this.snapshots[id] && this.snapshots[id].createdAt) {
this.snapshots[id].paused = false
} else {
this.recordCanvas(entry.target, id)
@ -67,7 +67,9 @@ class CanvasRecorder {
* */
// observer.unobserve(entry.target)
} else {
this.snapshots[id].paused = true
if (this.snapshots[id]) {
this.snapshots[id].paused = true
}
}
}
})