From 55e17ceb608cc04f91a420cbb94c8df80a1bdd0f Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 4 Apr 2020 23:26:34 -0400 Subject: [PATCH] Fixed issues with manual skipping --- src/components/NoticeComponent.tsx | 5 +++- src/components/SkipNoticeComponent.tsx | 36 ++++++++++++++++---------- src/content.ts | 7 +++-- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index 7e8bbf61..97b1040d 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -32,7 +32,10 @@ class NoticeComponent extends React.Component { constructor(props: NoticeProps) { super(props); - let maxCountdownTime = props.maxCountdownTime || (() => 4); + let maxCountdownTime = () => { + if (this.props.maxCountdownTime) return this.props.maxCountdownTime(); + else return 4; + }; //the id for the setInterval running the countdown this.countdownInterval = null; diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 3cf3831f..07572de6 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -2,9 +2,13 @@ import * as React from "react"; import Config from "../config" import { ContentContainer } from "../types"; +import Utils from "../utils"; +var utils = new Utils(); + import NoticeComponent from "./NoticeComponent"; import NoticeTextSelectionComponent from "./NoticeTextSectionComponent"; + export interface SkipNoticeProps { UUID: string; autoSkip: boolean; @@ -79,6 +83,10 @@ class SkipNoticeComponent extends React.Component - {/* Never show button if manualSkip is disabled */} + {/* Never show button if autoSkip is enabled */} {!this.autoSkip ? "" :