mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Fix help page not closing from keybind
This commit is contained in:
@@ -163,7 +163,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
|
||||
this.guidelinesReminder?.close();
|
||||
this.noticeRef.current.close(true);
|
||||
|
||||
this.contentContainer().resetSponsorSubmissionNotice();
|
||||
this.contentContainer().resetSponsorSubmissionNotice(false);
|
||||
|
||||
this.props.closeListener();
|
||||
}
|
||||
|
||||
@@ -1878,8 +1878,8 @@ function dontShowNoticeAgain() {
|
||||
/**
|
||||
* Helper method for the submission notice to clear itself when it closes
|
||||
*/
|
||||
function resetSponsorSubmissionNotice() {
|
||||
submissionNotice?.close();
|
||||
function resetSponsorSubmissionNotice(callRef = true) {
|
||||
submissionNotice?.close(callRef);
|
||||
submissionNotice = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class SubmissionNotice {
|
||||
contentContainer={contentContainer}
|
||||
callback={callback}
|
||||
ref={this.noticeRef}
|
||||
closeListener={() => 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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user