Set _loading flag in diff-view while awaiting API
Previously, PolyGerrit relied on the default value of the loading flag
in the diff view to show/hide the appropriate diff panels (or loading
message). Because of this, stale information is displayed when a user
navigates between different files within the same diff view.
With this change, the `_loading` flag is set before the major API calls
are made, and the loading message is made more obvious.
Bug: Issue 7381
Change-Id: Id70d981a2c72fef9f44a32c5463dc43c3ce41cf6
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
index c4746f2..8455e1c 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
@@ -540,6 +540,7 @@
promises.push(this._getChangeEdit(this._changeNum));
+ this._loading = true;
Promise.all(promises).then(r => {
const edit = r[4];
if (edit) {