From 2c1f5f16c2c60dd21973dd91d0226ec0980e1ea8 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 4 Sep 2021 01:44:09 -0400 Subject: [PATCH] Only show mute option for supported categories --- config.json.example | 12 +++++++++++- src/components/SponsorTimeEditComponent.tsx | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config.json.example b/config.json.example index 5793649a..ffc482a5 100644 --- a/config.json.example +++ b/config.json.example @@ -2,5 +2,15 @@ "serverAddress": "https://sponsor.ajay.app", "testingServerAddress": "https://sponsor.ajay.app/test", "serverAddressComment": "This specifies the default SponsorBlock server to connect to", - "categoryList": ["sponsor", "selfpromo", "interaction", "poi_highlight", "intro", "outro", "preview", "music_offtopic"] + "categoryList": ["sponsor", "selfpromo", "interaction", "poi_highlight", "intro", "outro", "preview", "music_offtopic"], + "categorySupport": { + "sponsor": ["skip", "mute"], + "selfpromo": ["skip", "mute"], + "interaction": ["skip", "mute"], + "intro": ["skip"], + "outro": ["skip"], + "preview": ["skip"], + "music_offtopic": ["skip"], + "poi_highlight": ["skip"] + } } diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 5664f7a9..673cba3c 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -191,14 +191,14 @@ class SponsorTimeEditComponent extends React.Component {/* Action Type */} - {getCategoryActionType(sponsorTime.category) === CategoryActionType.Skippable ? ( + {CompileConfig.categorySupport[sponsorTime.category]?.length > 1 ? (
): ""} @@ -284,10 +284,10 @@ class SponsorTimeEditComponent extends React.Component