diff options
author | Ben Rohlfs <brohlfs@google.com> | 2023-08-18 15:16:32 +0200 |
---|---|---|
committer | Ben Rohlfs <brohlfs@google.com> | 2023-08-21 09:11:20 +0000 |
commit | 00dba302fa6addc4dc221c7f7f58d270e7cdf9ff (patch) | |
tree | 45c5a308884670e4c359fd7b46f804296e068ff6 | |
parent | ce09ebdbe9d1ada2cdb747b8fd7362669e460a97 (diff) |
Start observing nodes in gr-diff early
Otherwise the comments and key locations are not available until after
the diff is already rendered. And we need those for diff processing,
which comes before rendering. The processor needs to know which chunks
to expand.
Release-Notes: skip
Google-Bug-Id: b/296294647
Change-Id: I47dc63a0c0e61f34f3937bd50a3a8d24d17d1692
-rw-r--r-- | polygerrit-ui/app/embed/diff/gr-diff/gr-diff.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/polygerrit-ui/app/embed/diff/gr-diff/gr-diff.ts b/polygerrit-ui/app/embed/diff/gr-diff/gr-diff.ts index 5d23da12fb..b3c7dad688 100644 --- a/polygerrit-ui/app/embed/diff/gr-diff/gr-diff.ts +++ b/polygerrit-ui/app/embed/diff/gr-diff/gr-diff.ts @@ -319,9 +319,14 @@ export class GrDiff extends LitElement implements GrDiffApi { if (this.diffElement) { this.highlights.init(this.diffElement, this); } + this.observeNodes(); } override disconnectedCallback() { + if (this.nodeObserver) { + this.nodeObserver.disconnect(); + this.nodeObserver = undefined; + } this.removeSelectionListeners(); this.diffSelection.cleanup(); this.highlights.cleanup(); @@ -422,7 +427,6 @@ export class GrDiff extends LitElement implements GrDiffApi { if (changedProperties.has('groups')) { if (this.groups?.length > 0) { this.loading = false; - this.observeNodes(); } } } |