summaryrefslogtreecommitdiff
path: root/source/features/edit-files-faster.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'source/features/edit-files-faster.tsx')
-rw-r--r--source/features/edit-files-faster.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/features/edit-files-faster.tsx b/source/features/edit-files-faster.tsx
index 285607d9..75c1358d 100644
--- a/source/features/edit-files-faster.tsx
+++ b/source/features/edit-files-faster.tsx
@@ -6,7 +6,7 @@ import * as pageDetect from 'github-url-detection';
import {wrap} from '../helpers/dom-utils';
import features from '.';
-import {parseRoute} from '../github-helpers';
+import parseRoute from '../github-helpers/parse-route';
import getDefaultBranch from '../github-helpers/get-default-branch';
import onFileListUpdate from '../github-events/on-file-list-update';
@@ -15,13 +15,13 @@ async function init(): Promise<void> {
const isPermalink = /Tag|Tree/.test(select('.branch-select-menu i')!.textContent!);
for (const fileIcon of select.all('.files :not(a) > .octicon-file')) {
const {pathname} = fileIcon.closest('tr')!.querySelector<HTMLAnchorElement>('.js-navigation-open')!;
- const pathnameParts = parseRoute(pathname);
- pathnameParts[3] = 'edit'; // Replaces /blob/
+ const path = parseRoute(pathname);
+ path.route = 'edit'; // Replaces /blob/
if (isPermalink) {
- pathnameParts[4] = defaultBranch; // Replaces /${tag|commit}/
+ path.branch = defaultBranch; // Replaces /${tag|commit}/
}
- wrap(fileIcon, <a href={pathnameParts.join('/')} className="rgh-edit-files-faster"/>);
+ wrap(fileIcon, <a href={path.toString()} className="rgh-edit-files-faster"/>);
fileIcon.after(<PencilIcon/>);
}
}