File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,9 @@ export class StackableFixture {
88 this . page = page
99 }
1010
11- // When loading the Stackable settings in the Admin, there are 4 requests to wp/v2/settings
12- // This function waits for all 4 requests to finish to ensure Stackable settings are loaded and reflected on the page
11+ // Wait for Stackable Settings to be fetched
1312 async waitForSettings ( ) : Promise < void > {
1413 return new Promise ( ( resolve , reject ) => {
15- let responseCount = 0
16-
1714 const cleanup = ( ) => {
1815 this . page . off ( 'requestfinished' , finishedCallback )
1916 this . page . off ( 'requestfinished' , failedCallback )
@@ -29,14 +26,10 @@ export class StackableFixture {
2926 } )
3027
3128 if ( settings ) {
32- responseCount ++
33- } else {
34- throw Error ( 'Failed to get Stackable settings' )
35- }
36-
37- if ( responseCount === 4 ) {
3829 cleanup ( )
3930 resolve ( )
31+ } else {
32+ throw Error ( 'Failed to get Stackable settings' )
4033 }
4134 } catch ( error ) {
4235 cleanup ( )
You can’t perform that action at this time.
0 commit comments