Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed destroy process of a single editor instance working within Context #356

Merged
merged 3 commits into from Jan 4, 2023

Conversation

Mgsy
Copy link
Member

@Mgsy Mgsy commented Jan 4, 2023

Suggested merge commit message (convention)

Fix: Fixed destroy process of a single editor instance working within Context. Closes #354.

@Mgsy Mgsy requested a review from psmyrek January 4, 2023 13:33
@coveralls
Copy link

Pull Request Test Coverage Report for Build 510

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 492: 0.0%
Covered Lines: 184
Relevant Lines: 184

💛 - Coveralls

Copy link
Contributor

@psmyrek psmyrek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Comment on lines +148 to 151
/* istanbul ignore next */
if ( this.watchdog ) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this condition is no longer necessary. It was added while we were working on double rendering issue. But I leave it just in case.

Comment on lines +240 to +250
setTimeout( () => {
if ( this.watchdog ) {
this.watchdog.destroy().then( () => {
this.watchdog = null;

resolve();
} );
} else {
resolve();
} );
} else {
resolve();
}
}
} );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea how to get rid of this setTimeout(), as the <CKEditor /> does not know if <CKEditorContex /> is going to destroy the editor.

Let's keep it as it is.

//
// See #354 for more information.
if ( this._contextWatchdog.state === 'ready' ) {
return this._contextWatchdog.remove( this._id );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The this._contextWatchdog.remove() returns a promise, as expected.

@psmyrek psmyrek merged commit 446a76b into master Jan 4, 2023
@psmyrek psmyrek deleted the i/354 branch January 4, 2023 13:43
@Aerophite
Copy link

This appears to have fixed #351 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't destroy the editor within a context
4 participants