File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,10 @@ const ImportantTermsComponent = compose([
221221
222222 useEffect ( ( ) => {
223223 return ( ) => {
224+ if ( editorSubscription ) {
225+ editorSubscription ( ) ;
226+ editorSubscription = null ;
227+ }
224228 debouncedDisplayRelevantDetails . cancel ( ) ;
225229 }
226230} , [ ] ) ;
@@ -316,4 +320,21 @@ const handleEditorChange = () => {
316320
317321const debouncedHandleEditorChange = debounce ( handleEditorChange , 3000 ) ;
318322
319- subscribe ( debouncedHandleEditorChange ) ;
323+ let editorSubscription = null ;
324+
325+ const subscribeEditorChange = ( ) => {
326+ if ( editorSubscription ) {
327+ editorSubscription ( ) ;
328+ editorSubscription = null ;
329+ }
330+
331+ editorSubscription = subscribe ( debouncedHandleEditorChange ) ;
332+ } ;
333+
334+ const clearGlobalVariables = ( ) => {
335+ globalHighlightingState = false ;
336+ lastComputedContent = '' ;
337+ lastComputedTerms = '' ;
338+ } ;
339+
340+ subscribeEditorChange ( ) ;
Original file line number Diff line number Diff line change 66 * Author URI: https://infinitnet.io/
77 * Plugin URI: https://infinitnet.io/relevant-density-optimizer/
88 * Update URI: https://github.com/infinitnet/relevant-density-optimizer
9- * Version: 1.6.3
9+ * Version: 1.6.4
1010 * License: GPLv3
1111 * Text Domain: relevant-density-optimizer
1212 */
1313
1414namespace Infinitnet \RDO ;
1515
16- define ('RDO_VERSION ' , '1.6.3 ' );
16+ define ('RDO_VERSION ' , '1.6.4 ' );
1717
1818function rdo_enqueue_block_editor_assets () {
1919 if (!wp_script_is ('rdo-plugin-js ' , 'enqueued ' )) {
You can’t perform that action at this time.
0 commit comments