diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 4a515270..fefa5040 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -4,6 +4,7 @@ import Config from "../config" import { Category, ContentContainer, CategoryActionType, SponsorHideType, SponsorTime, NoticeVisbilityMode, ActionType } from "../types"; import NoticeComponent from "./NoticeComponent"; import NoticeTextSelectionComponent from "./NoticeTextSectionComponent"; +import SubmissionNotice from "../render/SubmissionNotice"; import { getCategoryActionType, getSkippingText } from "../utils/categoryUtils"; @@ -12,6 +13,7 @@ export enum SkipNoticeAction { Upvote, Downvote, CategoryVote, + CopyDownvote, Unskip } @@ -203,12 +205,20 @@ class SkipNoticeComponent extends React.Component this.adjustDownvotingState(true)}> + {/* Copy and Downvote Button */} + this.prepAction(SkipNoticeAction.CopyDownvote)}> + : @@ -340,16 +350,6 @@ class SkipNoticeComponent extends React.Component this.forceUpdate(); - Config.configListeners.push(this.configListener); - this.setState({ choosingCategory: true, downvoting: false @@ -531,6 +536,24 @@ class SkipNoticeComponent extends React.Component unknown, ...messages: string[]): void { this.setState({ messages, @@ -557,7 +580,7 @@ class SkipNoticeComponent extends React.Component extends Map { this.update(); return result; } + + addArray(key: T, value: U) { + // Expand an array by value + let result = super.get(key).concat(value); + this.set(key, result); + this.update(); + return result; + } delete(key) { const result = super.delete(key); diff --git a/src/content.ts b/src/content.ts index 89e78938..b2ea4342 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1682,8 +1682,11 @@ function resetSponsorSubmissionNotice() { } function submitSponsorTimes() { - if (submissionNotice !== null) return; - + if (submissionNotice !== null){ + submissionNotice.noticeElement.style.display = (submissionNotice.noticeElement.style.display === "none") ? null : "none"; + return; + } + if (sponsorTimesSubmitting !== undefined && sponsorTimesSubmitting.length > 0) { submissionNotice = new SubmissionNotice(skipNoticeContentContainer, sendSubmitMessage); }