diff options
-rw-r--r-- | config.json.example | 12 | ||||
-rw-r--r-- | 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<SponsorTimeEditProps, Spo </div> {/* Action Type */} - {getCategoryActionType(sponsorTime.category) === CategoryActionType.Skippable ? ( + {CompileConfig.categorySupport[sponsorTime.category]?.length > 1 ? ( <div style={{position: "relative"}}> <select id={"sponsorTimeActionTypes" + this.idSuffix} className="sponsorTimeEditSelector sponsorTimeActionTypes" defaultValue={sponsorTime.actionType} ref={this.actionTypeOptionRef} onChange={() => this.saveEditTimes()}> - {this.getActionTypeOptions()} + {this.getActionTypeOptions(sponsorTime)} </select> </div> ): ""} @@ -284,10 +284,10 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo this.saveEditTimes(); } - getActionTypeOptions(): React.ReactElement[] { + getActionTypeOptions(sponsorTime: SponsorTime): React.ReactElement[] { const elements = []; - for (const actionType of ActionTypes) { + for (const actionType of CompileConfig.categorySupport[sponsorTime.category]) { elements.push( <option value={actionType} key={actionType}> |