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.guidelinesReminder?.close();
|
||||||
this.noticeRef.current.close(true);
|
this.noticeRef.current.close(true);
|
||||||
|
|
||||||
this.contentContainer().resetSponsorSubmissionNotice();
|
this.contentContainer().resetSponsorSubmissionNotice(false);
|
||||||
|
|
||||||
this.props.closeListener();
|
this.props.closeListener();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1878,8 +1878,8 @@ function dontShowNoticeAgain() {
|
|||||||
/**
|
/**
|
||||||
* Helper method for the submission notice to clear itself when it closes
|
* Helper method for the submission notice to clear itself when it closes
|
||||||
*/
|
*/
|
||||||
function resetSponsorSubmissionNotice() {
|
function resetSponsorSubmissionNotice(callRef = true) {
|
||||||
submissionNotice?.close();
|
submissionNotice?.close(callRef);
|
||||||
submissionNotice = null;
|
submissionNotice = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class SubmissionNotice {
|
|||||||
contentContainer={contentContainer}
|
contentContainer={contentContainer}
|
||||||
callback={callback}
|
callback={callback}
|
||||||
ref={this.noticeRef}
|
ref={this.noticeRef}
|
||||||
closeListener={() => this.close()} />,
|
closeListener={() => this.close(false)} />,
|
||||||
this.noticeElement
|
this.noticeElement
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,8 @@ class SubmissionNotice {
|
|||||||
this.noticeRef.current.forceUpdate();
|
this.noticeRef.current.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
close(callRef = true): void {
|
||||||
|
if (callRef) this.noticeRef.current.cancel();
|
||||||
ReactDOM.unmountComponentAtNode(this.noticeElement);
|
ReactDOM.unmountComponentAtNode(this.noticeElement);
|
||||||
|
|
||||||
this.noticeElement.remove();
|
this.noticeElement.remove();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export interface ContentContainer {
|
|||||||
updatePreviewBar: () => void,
|
updatePreviewBar: () => void,
|
||||||
onMobileYouTube: boolean,
|
onMobileYouTube: boolean,
|
||||||
sponsorSubmissionNotice: SubmissionNotice,
|
sponsorSubmissionNotice: SubmissionNotice,
|
||||||
resetSponsorSubmissionNotice: () => void,
|
resetSponsorSubmissionNotice: (callRef?: boolean) => void,
|
||||||
updateEditButtonsOnPlayer: () => void,
|
updateEditButtonsOnPlayer: () => void,
|
||||||
previewTime: (time: number, unpause?: boolean) => void,
|
previewTime: (time: number, unpause?: boolean) => void,
|
||||||
videoInfo: VideoInfo,
|
videoInfo: VideoInfo,
|
||||||
|
|||||||
Reference in New Issue
Block a user