Browse Source

Merge pull request #19416 from sciecode/dev-finally

Examples: replace Promise.finally()
Mr.doob 5 years ago
parent
commit
0d1fb03215

+ 3 - 1
examples/js/loaders/BasisTextureLoader.js

@@ -185,8 +185,10 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
 
 			} );
 
+		// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
 		texturePending
-			.finally( () => {
+			.catch( () => true )
+			.then( () => {
 
 				if ( worker && taskID ) {
 

+ 3 - 1
examples/js/loaders/DRACOLoader.js

@@ -197,8 +197,10 @@ THREE.DRACOLoader.prototype = Object.assign( Object.create( THREE.Loader.prototy
 			.then( ( message ) => this._createGeometry( message.geometry ) );
 
 		// Remove task from the task list.
+		// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
 		geometryPending
-			.finally( () => {
+			.catch( () => true )
+			.then( () => {
 
 				if ( worker && taskID ) {
 

+ 3 - 1
examples/jsm/loaders/BasisTextureLoader.js

@@ -199,8 +199,10 @@ BasisTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ),
 
 			} );
 
+		// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
 		texturePending
-			.finally( () => {
+			.catch( () => true )
+			.then( () => {
 
 				if ( worker && taskID ) {
 

+ 3 - 1
examples/jsm/loaders/DRACOLoader.js

@@ -204,8 +204,10 @@ DRACOLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 			.then( ( message ) => this._createGeometry( message.geometry ) );
 
 		// Remove task from the task list.
+		// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
 		geometryPending
-			.finally( () => {
+			.catch( () => true )
+			.then( () => {
 
 				if ( worker && taskID ) {