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,