diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index f042bcd5..74114f9f 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -23,7 +23,8 @@ export interface SkipNoticeProps { // Contains functions and variables from the content script needed by the skip notice contentContainer: ContentContainer; - closeListener: () => void + closeListener: () => void; + showKeybindHint?: boolean; } export interface SkipNoticeState { @@ -44,6 +45,8 @@ export interface SkipNoticeState { thanksForVotingText?: string; //null until the voting buttons should be hidden actionState?: SkipNoticeAction; + + showKeybindHint?: boolean; } class SkipNoticeComponent extends React.Component { @@ -112,7 +115,9 @@ class SkipNoticeComponent extends React.Component this.prepAction(SkipNoticeAction.Unskip)}> - {this.state.unskipText + " (" + Config.config.skipKeybind + ")"} + {this.state.unskipText + (this.state.showKeybindHint ? " (" + Config.config.skipKeybind + ")" : "")} diff --git a/src/content.ts b/src/content.ts index f4652de7..ec4ff0ed 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1003,6 +1003,7 @@ function skipToTime(v: HTMLVideoElement, skipTime: number[], skippingSegments: S if (openNotice) { //send out the message saying that a sponsor message was skipped if (!Config.config.dontShowNotice || !autoSkip) { + skipNotices.forEach((notice) => notice.setShowKeybindHint(false)); skipNotices.push(new SkipNotice(skippingSegments, autoSkip, skipNoticeContentContainer)); } } diff --git a/src/render/SkipNotice.tsx b/src/render/SkipNotice.tsx index 9039dfc4..91ed8dd1 100644 --- a/src/render/SkipNotice.tsx +++ b/src/render/SkipNotice.tsx @@ -67,6 +67,12 @@ class SkipNotice { ); } + setShowKeybindHint(value: boolean): void { + this.skipNoticeRef.current.setState({ + showKeybindHint: value + }); + } + close(): void { ReactDOM.unmountComponentAtNode(this.noticeElement);