From f76132029052694e442cedff15fe9aad56669f63 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Thu, 11 Feb 2016 12:05:51 -0500 Subject: [PATCH] Prevent previous diff from showing up while rendering the next one Change-Id: Ic26d9f426bc1e3b9c26856dfbcae7854e22bfffd --- polygerrit-ui/app/elements/gr-diff.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/polygerrit-ui/app/elements/gr-diff.html b/polygerrit-ui/app/elements/gr-diff.html index d13f540886..50dc87fc9f 100644 --- a/polygerrit-ui/app/elements/gr-diff.html +++ b/polygerrit-ui/app/elements/gr-diff.html @@ -217,6 +217,14 @@ limitations under the License. }, reload: function(changeNum, patchRange, path) { + // If a diff takes a considerable amount of time to render, the previous + // diff can end up showing up while the DOM is constructed. Clear the + // content on a reload to prevent this. + this._diff = { + leftSide: [], + rightSide: [], + }; + var promises = [ this._prefsReady, this.$.diffXHR.generateRequest().completes