Selaa lähdekoodia

Address autoupdate

Garrett Johnson 5 vuotta sitten
vanhempi
commit
14538bb9c2
1 muutettua tiedostoa jossa 18 lisäystä ja 4 poistoa
  1. 18 4
      src/utilities/PriorityQueue.js

+ 18 - 4
src/utilities/PriorityQueue.js

@@ -49,7 +49,11 @@ class PriorityQueue {
 			items.push( item );
 			callbacks.set( item, prCallback );
 
-			this.scheduleJobRun();
+			if ( this.autoUpdate ) {
+
+				this.scheduleJobRun();
+
+			}
 
 		} );
 
@@ -88,13 +92,23 @@ class PriorityQueue {
 				.then( () => {
 
 					this.currJobs --;
-					this.scheduleJobRun();
+
+					if ( this.autoUpdate ) {
+
+						this.scheduleJobRun();
+
+					}
 
 				} )
 				.catch( () => {
 
 					this.currJobs --;
-					this.scheduleJobRun();
+
+					if ( this.autoUpdate ) {
+
+						this.scheduleJobRun();
+
+					}
 
 				} );
 
@@ -105,7 +119,7 @@ class PriorityQueue {
 
 	scheduleJobRun() {
 
-		if ( ! this.scheduled && this.autoUpdate ) {
+		if ( ! this.scheduled ) {
 
 			enqueueMicrotask( () => {