diff options
author | 2022-07-30 09:16:45 +0200 | |
---|---|---|
committer | 2022-07-30 14:16:45 +0700 | |
commit | 50cb93948c8ce0fe23a8f4dd8a62184562257220 (patch) | |
tree | 8a9c8180b9059c35f7468b9c69c49df4103f462c /source/features/easy-toggle-commit-messages.tsx | |
parent | 808c68f3745cfe15d1995546d5519b75dc9386e1 (diff) | |
download | refined-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.tsx | 8 |
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, { |