Skip to content

Commit

Permalink
fix(cloud-image-editor): destroy context
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Dec 1, 2023
1 parent bdd4a33 commit deb9d25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blocks/CloudImageEditor/src/CloudImageEditorBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { parseTabs } from './lib/parseTabs.js';
import { initState } from './state.js';
import { TEMPLATE } from './template.js';
import { TabId } from './toolbar-constants.js';
import { Data } from '@symbiotejs/symbiote';

export class CloudImageEditorBlock extends CloudImageEditorBase {
static className = 'cloud-image-editor';
Expand Down Expand Up @@ -78,6 +79,13 @@ export class CloudImageEditorBlock extends CloudImageEditorBase {
this.initEditor();
}

destroyCallback() {
super.destroyCallback();

// Destroy global editor's context
Data.deleteCtx(this.ctxName);
}

async updateImage() {
await this._waitForSize();

Expand Down

0 comments on commit deb9d25

Please sign in to comment.