Skip to content

Commit

Permalink
fix(camera-tab): added check removeEventListener (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
egordidenko authored Dec 12, 2024
1 parent b52e7bc commit 31cb01a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blocks/CameraSource/CameraSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ export class CameraSource extends UploaderBlock {

_destroy() {
for (const permission of DEFAULT_PERMISSIONS) {
this[`${permission}Response`].removeEventListener('change', this._handlePermissionsChange);
this[`${permission}Response`]?.removeEventListener('change', this._handlePermissionsChange);
}

navigator.mediaDevices.removeEventListener('devicechange', this._getDevices);
navigator.mediaDevices?.removeEventListener('devicechange', this._getDevices);
}

async destroyCallback() {
Expand Down

0 comments on commit 31cb01a

Please sign in to comment.