fixes 2511: remove canvas snapshot interval if its gone for any reason

This commit is contained in:
nick-delirium 2024-08-29 09:59:03 +02:00
parent 6e175f48c5
commit a788fadb1c
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 7 additions and 1 deletions

View file

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

View file

@ -115,9 +115,15 @@ class CanvasRecorder {
const int = setInterval(() => {
const cid = this.app.nodes.getID(node)
const canvas = cid ? this.app.nodes.getNode(cid) : undefined
if (!this.snapshots[id]) {
this.app.debug.log('Canvas is not present in {snapshots}')
clearInterval(int)
return
}
if (!canvas || !hasTag(canvas, 'canvas') || canvas !== node) {
this.app.debug.log('Canvas element not in sync')
clearInterval(int)
return
} else {
if (!this.snapshots[id].paused) {
if (this.options.useAnimationFrame) {