From 7371335b1df55a5b4fdd1ca3e4880986d7b159cf Mon Sep 17 00:00:00 2001 From: Aleksandr Grenishin Date: Wed, 5 Oct 2022 16:07:33 +0300 Subject: [PATCH] fix(file-item): cancel debounced thumb generation on element disconnect (#294) --- blocks/FileItem/FileItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/FileItem/FileItem.js b/blocks/FileItem/FileItem.js index f0ea45b8f..afd5cd1ea 100644 --- a/blocks/FileItem/FileItem.js +++ b/blocks/FileItem/FileItem.js @@ -332,7 +332,6 @@ export class FileItem extends UploaderBlock { destroyCallback() { super.destroyCallback(); - this._debouncedGenerateThumb.cancel(); FileItem.activeInstances.delete(this); this._reset(); @@ -353,6 +352,7 @@ export class FileItem extends UploaderBlock { disconnectedCallback() { super.disconnectedCallback(); + this._debouncedGenerateThumb.cancel(); this._observer?.disconnect(); }