Added delete function to new dialog

This commit is contained in:
Ajay Ramachandran
2020-03-11 19:35:20 -04:00
parent a182354254
commit 3063591a4c
7 changed files with 127 additions and 29 deletions

View File

@@ -1,8 +1,10 @@
import Config from "./config";
import { ContentContainer } from "./types";
import Utils from "./utils";
var utils = new Utils();
import runThePopup from "./popup";
import PreviewBar from "./js-components/previewBar";
@@ -91,20 +93,22 @@ var popupInitialised = false;
var submissionNotice: SubmissionNotice = null;
// Contains all of the functions and variables needed by the skip notice
var skipNoticeContentContainer = () => ({
var skipNoticeContentContainer: ContentContainer = () => ({
vote,
dontShowNoticeAgain,
unskipSponsorTime,
sponsorTimes,
sponsorTimesSubmitting,
hiddenSponsorTimes,
UUIDs,
v: video,
sponsorVideoID,
reskipSponsorTime,
hiddenSponsorTimes,
updatePreviewBar,
onMobileYouTube,
sponsorSubmissionNotice: submissionNotice,
resetSponsorSubmissionNotice
resetSponsorSubmissionNotice,
changeStartSponsorButton
});
//get messages from the background script and the popup
@@ -1136,8 +1140,8 @@ function clearSponsorTimes() {
}
//if skipNotice is null, it will not affect the UI
function vote(type, UUID, skipNotice: SkipNoticeComponent) {
if (skipNotice != null) {
function vote(type, UUID, skipNotice?: SkipNoticeComponent) {
if (skipNotice !== null && skipNotice !== undefined) {
//add loading info
skipNotice.addVoteButtonInfo.bind(skipNotice)("Loading...")
skipNotice.setNoticeInfoMessage.bind(skipNotice)();