From c2d709c4684d221c163ac43b37d191ecd342eda8 Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Wed, 27 Aug 2025 12:47:15 +0300 Subject: [PATCH] Improve destroy function --- frontend/src/userPanel/profile/imageCropper.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/userPanel/profile/imageCropper.ts b/frontend/src/userPanel/profile/imageCropper.ts index a76e32a..e3f52a2 100644 --- a/frontend/src/userPanel/profile/imageCropper.ts +++ b/frontend/src/userPanel/profile/imageCropper.ts @@ -214,8 +214,6 @@ export class ImageCropper { * Destroys the cropper and removes the canvas from DOM */ destroy(): void { - if (this.canvas.parentNode) { - this.canvas.parentNode.removeChild(this.canvas); - } + this.canvas.remove(); } }