summaryrefslogtreecommitdiff
path: root/source/features/clean-repo-filelist-actions.tsx
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2022-09-25 16:36:04 +0700
committerGravatar GitHub <noreply@github.com> 2022-09-25 16:36:04 +0700
commitda89c8ee20aa2d9ce8ac4fb5fc7225265539a8ab (patch)
treecd3ed5eea516a54ffbae7caf64095f8b00bd52d9 /source/features/clean-repo-filelist-actions.tsx
parent74785717376b427ad7177e5783af145cd0f8d861 (diff)
downloadrefined-github-da89c8ee20aa2d9ce8ac4fb5fc7225265539a8ab.tar.gz
refined-github-da89c8ee20aa2d9ce8ac4fb5fc7225265539a8ab.tar.zst
refined-github-da89c8ee20aa2d9ce8ac4fb5fc7225265539a8ab.zip
Warp speed 🚀 (#6006)
Diffstat (limited to 'source/features/clean-repo-filelist-actions.tsx')
-rw-r--r--source/features/clean-repo-filelist-actions.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/features/clean-repo-filelist-actions.tsx b/source/features/clean-repo-filelist-actions.tsx
index 09e60ea5..19461ece 100644
--- a/source/features/clean-repo-filelist-actions.tsx
+++ b/source/features/clean-repo-filelist-actions.tsx
@@ -1,9 +1,9 @@
import React from 'dom-chef';
import select from 'select-dom';
-import {observe} from 'selector-observer';
import * as pageDetect from 'github-url-detection';
import {PlusIcon, SearchIcon, CodeIcon} from '@primer/octicons-react';
+import observe from '../helpers/selector-observer';
import {wrap} from '../helpers/dom-utils';
import features from '../feature-manager';
@@ -16,7 +16,7 @@ function addTooltipToSummary(childElement: Element, tooltip: string): void {
}
function cleanFilelistActions(searchButton: Element): void {
- searchButton.classList.add('tooltipped', 'tooltipped-ne', 'rgh-repo-filelist-actions');
+ searchButton.classList.add('tooltipped', 'tooltipped-ne');
searchButton.setAttribute('aria-label', 'Go to file');
// Replace "Go to file" with icon
@@ -49,11 +49,9 @@ function cleanFilelistActions(searchButton: Element): void {
}
}
-function init(): Deinit {
+function init(signal: AbortSignal): void {
// `.btn` selects the desktop version
- return observe('.btn[data-hotkey="t"]:not(.rgh-repo-filelist-actions)', {
- add: cleanFilelistActions,
- });
+ observe('.btn[data-hotkey="t"]', cleanFilelistActions, {signal});
}
void features.add(import.meta.url, {
@@ -61,6 +59,6 @@ void features.add(import.meta.url, {
pageDetect.isRepoTree,
pageDetect.isSingleFile,
],
- deduplicate: 'has-rgh-inner',
+ awaitDomReady: false,
init,
});