Sfoglia il codice sorgente

Made the `destroyed` state before destructing.

Maciej Bukowski 6 anni fa
parent
commit
018e3a15a7
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      packages/ckeditor5-watchdog/src/watchdog.js

+ 4 - 4
packages/ckeditor5-watchdog/src/watchdog.js

@@ -239,14 +239,14 @@ export default class Watchdog {
 
 	/**
 	 * Destroys the current editor instance by using the destructor passed to the {@link #setDestructor `setDestructor()`} method
-	 * and set state to `destroyed`.
+	 * and sets state to `destroyed`.
 	 *
 	 * @returns {Promise}
 	 */
 	destroy() {
-		return this._destroy().then( () => {
-			this.state = 'destroyed';
-		} );
+		this.state = 'destroyed';
+
+		return this._destroy();
 	}
 
 	/**