summaryrefslogtreecommitdiff
path: root/source/features/enable-file-links-in-compare-view.tsx
diff options
context:
space:
mode:
authorGravatar Federico <me@fregante.com> 2020-11-03 00:32:48 -0600
committerGravatar GitHub <noreply@github.com> 2020-11-03 00:32:48 -0600
commit059a3cdca23d9925109e0c8cdb162ab2561aca5e (patch)
treece11c5b5128ecf3a49d273b669df51260e431684 /source/features/enable-file-links-in-compare-view.tsx
parent86ed023904f1545c831e46bb6a690e7853e5eca6 (diff)
downloadrefined-github-059a3cdca23d9925109e0c8cdb162ab2561aca5e.tar.gz
refined-github-059a3cdca23d9925109e0c8cdb162ab2561aca5e.tar.zst
refined-github-059a3cdca23d9925109e0c8cdb162ab2561aca5e.zip
Meta: Extract and extend `getRepositoryInfo` (#3695)20.11.5
Diffstat (limited to 'source/features/enable-file-links-in-compare-view.tsx')
-rw-r--r--source/features/enable-file-links-in-compare-view.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/features/enable-file-links-in-compare-view.tsx b/source/features/enable-file-links-in-compare-view.tsx
index ac4bb98e..82322c2a 100644
--- a/source/features/enable-file-links-in-compare-view.tsx
+++ b/source/features/enable-file-links-in-compare-view.tsx
@@ -6,7 +6,7 @@ import * as pageDetect from 'github-url-detection';
import features from '.';
import GitHubURL from '../github-helpers/github-url';
-import {getCurrentBranch, getPRRepositoryInfo} from '../github-helpers';
+import {getCurrentBranch, getPRHeadRepo} from '../github-helpers';
/** Rebuilds the "View file" link because it points to the base repo and to the commit, instead of the head repo and its branch */
function handlePRMenuOpening({delegateTarget: dropdown}: delegate.Event): void {
@@ -14,7 +14,7 @@ function handlePRMenuOpening({delegateTarget: dropdown}: delegate.Event): void {
const filePath = dropdown.closest('[data-path]')!.getAttribute('data-path')!;
const viewFile = select<HTMLAnchorElement>('[data-ga-click^="View file"]', dropdown)!;
- viewFile.pathname = [getPRRepositoryInfo().url!, 'blob', getCurrentBranch()!, filePath].join('/'); // Do not replace with `GitHubURL` #3152 #3111 #2595
+ viewFile.pathname = [getPRHeadRepo()!.nameWithOwner, 'blob', getCurrentBranch()!, filePath].join('/'); // Do not replace with `GitHubURL` #3152 #3111 #2595
}
function handleCompareMenuOpening({delegateTarget: dropdown}: delegate.Event): void {