From 25c04a49c131a4b4c9b2d229d4aa84d7ec36cbca Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 9 Jun 2022 14:02:23 -0400 Subject: [PATCH] Fix help page not closing from keybind --- src/components/SubmissionNoticeComponent.tsx | 2 +- src/content.ts | 4 ++-- src/render/SubmissionNotice.tsx | 5 +++-- src/types.ts | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index 65d50025..fea0c762 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -163,7 +163,7 @@ class SubmissionNoticeComponent extends React.Component this.close()} />, + closeListener={() => this.close(false)} />, this.noticeElement ); } @@ -44,7 +44,8 @@ class SubmissionNotice { this.noticeRef.current.forceUpdate(); } - close(): void { + close(callRef = true): void { + if (callRef) this.noticeRef.current.cancel(); ReactDOM.unmountComponentAtNode(this.noticeElement); this.noticeElement.remove(); diff --git a/src/types.ts b/src/types.ts index 1f3e6d76..48dfb7a8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,7 +16,7 @@ export interface ContentContainer { updatePreviewBar: () => void, onMobileYouTube: boolean, sponsorSubmissionNotice: SubmissionNotice, - resetSponsorSubmissionNotice: () => void, + resetSponsorSubmissionNotice: (callRef?: boolean) => void, updateEditButtonsOnPlayer: () => void, previewTime: (time: number, unpause?: boolean) => void, videoInfo: VideoInfo,