Skip to content

Commit

Permalink
fix item ending
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Dec 10, 2024
1 parent a581341 commit 01a230d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/client/components/CVAssetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class AssetLoadingManager extends LoadingManager
protected onLoadingError()
{
if (ENV_DEVELOPMENT) {
console.error(`Loading error`);
console.log(`Loading error`);
}

// trigger update
Expand Down
11 changes: 2 additions & 9 deletions source/client/io/ModelReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ export default class ModelReader
return this.loadModel(url, {signal})
.then(data=>this.gltfLoader.parseAsync(data, resourcePath))
.then(gltf=>this.createModelGroup(gltf))
.then((result)=>{
this.loadingManager.itemEnd(url);
return result;
}, (e)=> {
.catch((e)=> {
this.loadingManager.itemError(url);
throw e;
});
}).finally(()=> this.loadingManager.itemEnd( url ));
}

/**
Expand Down Expand Up @@ -147,7 +144,6 @@ export default class ModelReader
}

if(!this.loading[url]?.listeners.length){
this.loadingManager.itemStart( url );

this.loading[url] = {listeners:[], abortController: new AbortController()};

Expand All @@ -160,15 +156,12 @@ export default class ModelReader
//Skip all the progress tracking from FileLoader since we don't use it.
return r.arrayBuffer();
}).then(data=> {
this.loadingManager.itemEnd( url );
this.loading[url].listeners.forEach(({onload})=>onload(data));
}, (e)=>{
this.loading[url].listeners.forEach(({onerror})=>onerror(e));
if(e.name != "AbortError" && e.name != "ABORT_ERR"){
console.error(e);
this.loadingManager.itemError( url );
}
this.loadingManager.itemEnd( url );
}).finally(()=>{
delete this.loading[url];
});
Expand Down

0 comments on commit 01a230d

Please sign in to comment.