Refactor promise chains to avoid .finally
Use of .then following a use of .catch works the same as .finally. Bug: Issue 9650 Change-Id: Ic83b21e357141fbe889ad4e82c59eef222fa4847
This commit is contained in:
@@ -224,7 +224,7 @@
|
|||||||
this.$.reporting.dashboardDisplayed();
|
this.$.reporting.dashboardDisplayed();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
}).finally(() => { this._loading = false; });
|
}).then(() => { this._loading = false; });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -254,17 +254,20 @@
|
|||||||
return this._loadDiffAssets(diff);
|
return this._loadDiffAssets(diff);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.all([diffRequest, assetRequest]).then(results => {
|
return Promise.all([diffRequest, assetRequest])
|
||||||
const diff = results[0];
|
.then(results => {
|
||||||
if (!diff) {
|
const diff = results[0];
|
||||||
return Promise.resolve();
|
if (!diff) {
|
||||||
}
|
return Promise.resolve();
|
||||||
this.filesWeblinks = this._getFilesWeblinks(diff);
|
}
|
||||||
this._diff = diff;
|
this.filesWeblinks = this._getFilesWeblinks(diff);
|
||||||
return this._renderDiffTable();
|
this._diff = diff;
|
||||||
}).finally(() => {
|
return this._renderDiffTable();
|
||||||
this._loading = false;
|
})
|
||||||
});
|
.catch(err => {
|
||||||
|
console.warn('Error encountered loading diff:', err);
|
||||||
|
})
|
||||||
|
.then(() => { this._loading = false; });
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Cancel any remaining diff builder rendering work. */
|
/** Cancel any remaining diff builder rendering work. */
|
||||||
|
|||||||
Reference in New Issue
Block a user