-
Notifications
You must be signed in to change notification settings - Fork 101
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
/* istanbul ignore next */ | ||
if ( this.watchdog ) { | ||
return; | ||
} |
There was a problem hiding this comment.
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.
setTimeout( () => { | ||
if ( this.watchdog ) { | ||
this.watchdog.destroy().then( () => { | ||
this.watchdog = null; | ||
|
||
resolve(); | ||
} ); | ||
} else { | ||
resolve(); | ||
} ); | ||
} else { | ||
resolve(); | ||
} | ||
} | ||
} ); |
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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.
This appears to have fixed #351 as well |
Suggested merge commit message (convention)
Fix: Fixed destroy process of a single editor instance working within Context. Closes #354.