From 56b74d6863fdf733cc0284ba5def3322d7d109db Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 17 Aug 2021 21:44:57 -0400 Subject: [PATCH] Use "skipped to" for poi --- public/_locales/en/messages.json | 7 ++++++- src/components/SkipNoticeComponent.tsx | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 6494a9a4..1fc75527 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -289,7 +289,12 @@ "description": "Used for skipping to things (Skip to Highlight)" }, "skipped": { - "message": "Skipped" + "message": "{0} Skipped", + "description": "Example: Sponsor Skipped" + }, + "skipped_to_category": { + "message": "Skipped to {0}", + "description": "Used for skipping to things (Skipped to Highlight)" }, "disableAutoSkip": { "message": "Disable Auto Skip" diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 6329e717..63a53165 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -84,8 +84,12 @@ class SkipNoticeComponent extends React.Component 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) { + let noticeTitle = ""; + if (this.autoSkip) { + const messageId = utils.getCategoryActionType(this.segments[0].category) === CategoryActionType.Skippable + ? "skipped" : "skipped_to_category"; + noticeTitle = chrome.i18n.getMessage(messageId).replace("{0}", categoryName); + } else { const messageId = utils.getCategoryActionType(this.segments[0].category) === CategoryActionType.Skippable ? "skip_category" : "skip_to_category"; noticeTitle = chrome.i18n.getMessage(messageId).replace("{0}", categoryName); @@ -303,7 +307,9 @@ class SkipNoticeComponent extends React.Component 1 || utils.getCategoryActionType(this.segments[0].category) !== CategoryActionType.POI) { + if (this.segments.length > 1 + || utils.getCategoryActionType(this.segments[0].category) !== CategoryActionType.POI + || this.props.unskipTime) { return (