mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-20 13:03:45 +02:00
Fix help page not closing from keybind
This commit is contained in:
parent
32a3cb2cfe
commit
25c04a49c1
4 changed files with 7 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue