diff options
author | Max Baumann <[email protected]> | 2020-12-12 22:57:41 +0100 |
---|---|---|
committer | Max Baumann <[email protected]> | 2020-12-12 22:57:41 +0100 |
commit | 36558f5460bb843598d72bff3998074dc40bbdaf (patch) | |
tree | 5ca88653e45162a1e220bdc7a043190bf0ce421f /src/components/SkipNoticeComponent.tsx | |
parent | 105c148ccc2ee589dc47716a963835687013d683 (diff) | |
download | SponsorBlock-36558f5460bb843598d72bff3998074dc40bbdaf.tar.gz SponsorBlock-36558f5460bb843598d72bff3998074dc40bbdaf.zip |
refactor(lint): apply automatic eslint fixes
Diffstat (limited to 'src/components/SkipNoticeComponent.tsx')
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 00bb52f3..fb74c880 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -4,7 +4,7 @@ import Config from "../config" import { ContentContainer, SponsorHideType, SponsorTime } from "../types"; import Utils from "../utils"; -var utils = new Utils(); +const utils = new Utils(); import NoticeComponent from "./NoticeComponent"; import NoticeTextSelectionComponent from "./NoticeTextSectionComponent"; @@ -74,7 +74,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta this.contentContainer = props.contentContainer; this.audio = null; - let categoryName = chrome.i18n.getMessage(this.segments.length > 1 ? "multipleSegments" + const categoryName = chrome.i18n.getMessage(this.segments.length > 1 ? "multipleSegments" : "category_" + this.segments[0].category + "_short") || chrome.i18n.getMessage("category_" + this.segments[0].category); let noticeTitle = categoryName + " " + chrome.i18n.getMessage("skipped"); if (!this.autoSkip) { @@ -98,7 +98,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta if (this.amountOfPreviousNotices > 0) { //another notice exists - let previousNotice = document.getElementsByClassName("sponsorSkipNotice")[0]; + const previousNotice = document.getElementsByClassName("sponsorSkipNotice")[0]; previousNotice.classList.add("secondSkipNotice") } @@ -137,7 +137,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta } render() { - let noticeStyle: React.CSSProperties = { + const noticeStyle: React.CSSProperties = { zIndex: 50 + this.amountOfPreviousNotices } if (this.contentContainer().onMobileYouTube) { @@ -286,7 +286,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta } getSubmissionChooser(): JSX.Element[] { - let elements: JSX.Element[] = []; + const elements: JSX.Element[] = []; for (let i = 0; i < this.segments.length; i++) { elements.push( @@ -321,7 +321,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta ); } - let elements: JSX.Element[] = []; + const elements: JSX.Element[] = []; for (let i = 0; i < this.state.messages.length; i++) { elements.push( @@ -397,7 +397,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta } getCategoryOptions() { - let elements = []; + const elements = []; for (const category of Config.config.categorySelections) { elements.push( @@ -448,10 +448,10 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta } getUnskippedModeInfo(index: number, buttonText: string) { - let self = this; - let maxCountdownTime = function() { - let sponsorTime = self.segments[index]; - let duration = Math.round((sponsorTime.segment[1] - self.contentContainer().v.currentTime) * (1 / self.contentContainer().v.playbackRate)); + const self = this; + const maxCountdownTime = function() { + const sponsorTime = self.segments[index]; + const duration = Math.round((sponsorTime.segment[1] - self.contentContainer().v.currentTime) * (1 / self.contentContainer().v.playbackRate)); return Math.max(duration, 4); }; |