summaryrefslogtreecommitdiff
path: root/source/features/easy-toggle-commit-messages.tsx
diff options
context:
space:
mode:
authorGravatar Florent <cheap.glitch@gmail.com> 2022-07-30 09:16:45 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-30 14:16:45 +0700
commit50cb93948c8ce0fe23a8f4dd8a62184562257220 (patch)
tree8a9c8180b9059c35f7468b9c69c49df4103f462c /source/features/easy-toggle-commit-messages.tsx
parent808c68f3745cfe15d1995546d5519b75dc9386e1 (diff)
downloadrefined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.tar.gz
refined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.tar.zst
refined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.zip
Meta: Deinit all feature delegates using `AbortSignal` (#5726)
Co-authored-by: Federico Brigante <me@fregante.com>
Diffstat (limited to 'source/features/easy-toggle-commit-messages.tsx')
-rw-r--r--source/features/easy-toggle-commit-messages.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/features/easy-toggle-commit-messages.tsx b/source/features/easy-toggle-commit-messages.tsx
index 33b9040f..22e34bd4 100644
--- a/source/features/easy-toggle-commit-messages.tsx
+++ b/source/features/easy-toggle-commit-messages.tsx
@@ -1,10 +1,10 @@
import select from 'select-dom';
-import delegate from 'delegate-it';
import * as pageDetect from 'github-url-detection';
+import delegate, {DelegateEvent} from 'delegate-it';
import features from '.';
-function toggleCommitMessage(event: delegate.Event<MouseEvent>): void {
+function toggleCommitMessage(event: DelegateEvent<MouseEvent>): void {
const elementClicked = event.target as HTMLElement;
// The clicked element is not a button, a link or a popup ("Verified" badge, CI details, etc.)
if (!elementClicked.closest('a, button, clipboard-copy, details')) {
@@ -19,8 +19,8 @@ const commitMessagesSelector = [
':is(.file-navigation, .js-permalink-shortcut) ~ .Box .Box-header', // Commit message in file tree header
].join(',');
-function init(): Deinit {
- return delegate(document, commitMessagesSelector, 'click', toggleCommitMessage);
+function init(signal: AbortSignal): void {
+ delegate(document, commitMessagesSelector, 'click', toggleCommitMessage, {signal});
}
void features.add(import.meta.url, {