Skip to content

Commit

Permalink
refactor: remove Promise.finally (#671)
Browse files Browse the repository at this point in the history
* refactor: remove Promise.finally

Co-authored-by: lizhigao <lizhigao@021.com>
  • Loading branch information
Cleam and lizhigao authored Mar 3, 2022
1 parent 339a4a5 commit 5140986
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/asset/ResourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ export class ResourceManager {
promise
.then((res: EngineObject) => {
if (loader.useCache) this._addAsset(url, res);
delete this._loadingPromises[url];
})
.catch((err: Error) => Promise.reject(err))
.finally(() => {
.catch((err: Error) => {
Promise.reject(err)
delete this._loadingPromises[url];
});
return promise;
Expand Down

0 comments on commit 5140986

Please sign in to comment.