diff options
author | 2022-03-18 11:36:42 +0100 | |
---|---|---|
committer | 2022-03-18 11:36:42 +0100 | |
commit | afb434cd033a085cf7b226b0d6f8d84f326813d6 (patch) | |
tree | 766cd46b22a1d38433bac61aecbc1db7b6473797 /source/features/clean-repo-filelist-actions.tsx | |
parent | a6dfe8444665bd639a14ab3094029486ea7efc03 (diff) | |
download | refined-github-afb434cd033a085cf7b226b0d6f8d84f326813d6.tar.gz refined-github-afb434cd033a085cf7b226b0d6f8d84f326813d6.tar.zst refined-github-afb434cd033a085cf7b226b0d6f8d84f326813d6.zip |
Meta: Correctly deinit all features (#5422)
Co-authored-by: Federico Brigante <me@fregante.com>
Diffstat (limited to 'source/features/clean-repo-filelist-actions.tsx')
-rw-r--r-- | source/features/clean-repo-filelist-actions.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/features/clean-repo-filelist-actions.tsx b/source/features/clean-repo-filelist-actions.tsx index c8a3881c..9105826f 100644 --- a/source/features/clean-repo-filelist-actions.tsx +++ b/source/features/clean-repo-filelist-actions.tsx @@ -1,6 +1,5 @@ import React from 'dom-chef'; import select from 'select-dom'; -import onetime from 'onetime'; import {observe} from 'selector-observer'; import * as pageDetect from 'github-url-detection'; import {PlusIcon, SearchIcon, CodeIcon} from '@primer/octicons-react'; @@ -16,9 +15,9 @@ function addTooltipToSummary(childElement: Element, tooltip: string): void { ); } -function init(): void { +function init(): Deinit { // `.btn` selects the desktop version - observe('.btn[data-hotkey="t"]:not(.rgh-repo-filelist-actions)', { + return observe('.btn[data-hotkey="t"]:not(.rgh-repo-filelist-actions)', { add(searchButton) { searchButton.classList.add('tooltipped', 'tooltipped-ne', 'rgh-repo-filelist-actions'); searchButton.setAttribute('aria-label', 'Go to file'); @@ -61,5 +60,5 @@ void features.add(import.meta.url, { pageDetect.isSingleFile, ], deduplicate: 'has-rgh-inner', - init: onetime(init), + init, }); |