Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95d7d34

Browse files
committed
Deduplicate LOC panel across the /files to /changes soft-redirect
GitHub fires an extra navigation event when /files soft-redirects to the React /changes view, so init ran twice before the first run's abort signal fired, appending a second panel. Use the feature-manager's deduplicate guard keyed on the panel's own class.
1 parent a43d139 commit 95d7d34

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

source/features/coder-pr-loc-stats.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ void features.add(import.meta.url, {
219219
asLongAs: [isCoderRepo],
220220
include: [pageDetect.isPRFiles],
221221
exclude: [pageDetect.isPRFile404, pageDetect.isPRCommit],
222+
// GitHub fires an extra navigation event when `/files` soft-redirects to
223+
// the React `/changes` view, running `init` again before the first run
224+
// is aborted and duplicating the panel.
225+
deduplicate: '.rgh-coder-loc-stats',
222226
init,
223227
});
224228

0 commit comments

Comments
 (0)