diff options
author | Ajay Ramachandran <[email protected]> | 2021-09-04 01:44:09 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-09-04 01:44:09 -0400 |
commit | 2c1f5f16c2c60dd21973dd91d0226ec0980e1ea8 (patch) | |
tree | 032b0a3693358ef7c3b0f909ef341b86517e8bc9 /src | |
parent | 0e7a298967bab4e1c687555db53f955d3195b139 (diff) | |
download | SponsorBlock-2c1f5f16c2c60dd21973dd91d0226ec0980e1ea8.tar.gz SponsorBlock-2c1f5f16c2c60dd21973dd91d0226ec0980e1ea8.zip |
Only show mute option for supported categories
Diffstat (limited to 'src')
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
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}> |