Add a stop-gap fix for the comment rendering.
We add `layers` as a trigger for updating threads.
This probably doesn't address the real issue. If gr-diff gets
re-created but the `changedProperties` in the corresponding update
doesn't contain the trigger for threads, then threads will be missing,
because we add them manually through `appendChild`.
Google-Bug-Id: b/285164720
Release-Notes: skip
Change-Id: Iec70f2cd646952740ca025b289e507b7e798a926
(cherry picked from commit 7241bb0ba318822c1e7f7a587f9c2ad98c02be03)
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
index 2ccae8d..6cc4048 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
+++ b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
@@ -454,7 +454,9 @@
// this method calls getThreadEls which inspects the DOM. Also <gr-diff>
// only starts observing nodes (for thread element changes) after rendering
// is done.
- if (changedProperties.has('threads')) {
+ // Change in layers will likely cause gr-diff to update. Since we add
+ // threads manually we need to call threadsChanged in this case as well.
+ if (changedProperties.has('threads') || changedProperties.has('layers')) {
this.threadsChanged(this.threads);
}
}