Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0757f42 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Dec 7, 2023
1 parent 889a831 commit ca145ed
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 21 deletions.
13 changes: 8 additions & 5 deletions abstract/ActivityBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ export class ActivityBlock extends Block {
this.$['*history'] = [];
}
});
this.sub('*modalActive', (modalActive) => {
if (!modalActive && this.activityType === this.$['*currentActivity']) {
this.$['*currentActivity'] = null;
}
});

if (this.has('*modalActive')) {
this.sub('*modalActive', (modalActive) => {
if (!modalActive && this.activityType === this.$['*currentActivity']) {
this.$['*currentActivity'] = null;
}
});
}
}
}

Expand Down
12 changes: 10 additions & 2 deletions abstract/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,19 @@ export class Block extends BaseComponent {
Data.deleteCtx(this);

if (blocksRegistry.size === 0) {
// Destroy external context if there is no any blocks left inside it
Data.deleteCtx(this.ctxName);
this.destroyCtxCallback();
}
}

/**
* Called when the last block is removed from the context. Note that inheritors must run their callback before that.
*
* @protected
*/
destroyCtxCallback() {
Data.deleteCtx(this.ctxName);
}

/**
* @param {Number} bytes
* @param {Number} [decimals]
Expand Down
1 change: 1 addition & 0 deletions abstract/CTX.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export const uploaderBlockCtx = (fnCtx) => ({
'*focusedEntry': null,
'*uploadMetadata': null,
'*uploadQueue': new Queue(1),
'*uploadCollection': null,
});
18 changes: 11 additions & 7 deletions abstract/UploaderBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class UploaderBlock extends ActivityBlock {
initCallback() {
super.initCallback();

if (!this.has('*uploadCollection')) {
if (!this.$['*uploadCollection']) {
let uploadCollection = new TypedCollection({
typedSchema: uploadEntrySchema,
watchList: [
Expand All @@ -82,7 +82,7 @@ export class UploaderBlock extends ActivityBlock {
'cdnUrlModifiers',
],
});
this.add('*uploadCollection', uploadCollection);
this.$['*uploadCollection'] = uploadCollection;
}

if (!this.hasCtxOwner && this.couldBeCtxOwner) {
Expand All @@ -92,11 +92,15 @@ export class UploaderBlock extends ActivityBlock {

destroyCallback() {
super.destroyCallback();
if (this.isCtxOwner) {
this._unobserveCollectionProperties?.();
this._unobserveCollection?.();
this.uploadCollection.destroy();
}
}

destroyCtxCallback() {
this._unobserveCollectionProperties?.();
this._unobserveCollection?.();
this.uploadCollection.destroy();
this.$['*uploadCollection'] = null;

super.destroyCtxCallback();
}

initCtxOwner() {
Expand Down
4 changes: 2 additions & 2 deletions web/blocks.iife.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/blocks.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/lr-cloud-image-editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/lr-file-uploader-inline.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/lr-file-uploader-minimal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/lr-file-uploader-regular.min.js

Large diffs are not rendered by default.

0 comments on commit ca145ed

Please sign in to comment.