diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index a988207e..3aa330c8 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -20,17 +20,11 @@ class NoticeComponent extends React.Component { countdownInterval: NodeJS.Timeout; idSuffix: any; - timed: boolean - amountOfPreviousNotices: number; constructor(props: NoticeProps) { super(props); - // Set default to timed - this.timed = props.timed; - if (this.timed === undefined) this.timed = true; - if (props.maxCountdownTime === undefined) props.maxCountdownTime = () => 4; //the id for the setInterval running the countdown @@ -91,7 +85,7 @@ class NoticeComponent extends React.Component { style={{top: "11px"}}> {/* Time left */} - {this.timed ? ( + {this.props.timed ? ( @@ -116,7 +110,7 @@ class NoticeComponent extends React.Component { //called every second to lower the countdown before hiding the notice countdown() { - if (!this.timed) return; + if (!this.props.timed) return; let countdownTime = this.state.countdownTime - 1; @@ -143,7 +137,7 @@ class NoticeComponent extends React.Component { } pauseCountdown() { - if (!this.timed) return; + if (!this.props.timed) return; //remove setInterval clearInterval(this.countdownInterval); @@ -162,7 +156,7 @@ class NoticeComponent extends React.Component { } startCountdown() { - if (!this.timed) return; + if (!this.props.timed) return; //if it has already started, don't start it again if (this.countdownInterval !== null) return; @@ -176,7 +170,7 @@ class NoticeComponent extends React.Component { } resetCountdown() { - if (!this.timed) return; + if (!this.props.timed) return; this.setState({ countdownTime: this.props.maxCountdownTime(), diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 236f4f05..50cc34a9 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -87,6 +87,7 @@ class SkipNoticeComponent extends React.Component