diff --git a/packages/js/src/components/Indexation.js b/packages/js/src/components/Indexation.js index 52c359287f7..148f189bfcc 100644 --- a/packages/js/src/components/Indexation.js +++ b/packages/js/src/components/Indexation.js @@ -155,6 +155,8 @@ class Indexation extends Component { firstTime: false, } ); } ); + + url = false; } } } @@ -168,6 +170,10 @@ class Indexation extends Component { for ( const endpoint of Object.keys( this.settings.restApi.indexing_endpoints ) ) { await this.doIndexing( endpoint ); } + + // Wait until the next cycle, to make sure the state is updated before checking it. + await new Promise( resolve => setTimeout( resolve, 0 ) ); + /* * Set the indexing process as completed only when there is no error * and the user has not stopped the process manually. diff --git a/packages/js/src/first-time-configuration/tailwind-components/steps/indexation/indexation.js b/packages/js/src/first-time-configuration/tailwind-components/steps/indexation/indexation.js index ad76028a1eb..df6cb1c09ae 100644 --- a/packages/js/src/first-time-configuration/tailwind-components/steps/indexation/indexation.js +++ b/packages/js/src/first-time-configuration/tailwind-components/steps/indexation/indexation.js @@ -158,6 +158,8 @@ class Indexation extends Component { firstTime: false, } ); } ); + + url = false; } } } @@ -171,6 +173,10 @@ class Indexation extends Component { for ( const endpoint of Object.keys( this.settings.restApi.indexing_endpoints ) ) { await this.doIndexing( endpoint ); } + + // Wait until the next cycle, to make sure the state is updated before checking it. + await new Promise( resolve => setTimeout( resolve, 0 ) ); + /* * Set the indexing process as completed only when there is no error * and the user has not stopped the process manually.