Use default action type from config

This commit is contained in:
Ajay Ramachandran
2021-10-14 00:03:48 -04:00
parent acd2720372
commit f2c1ee4894
2 changed files with 7 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
"serverAddress": "https://sponsor.ajay.app", "serverAddress": "https://sponsor.ajay.app",
"testingServerAddress": "https://sponsor.ajay.app/test", "testingServerAddress": "https://sponsor.ajay.app/test",
"serverAddressComment": "This specifies the default SponsorBlock server to connect to", "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", "chapter"],
"categorySupport": { "categorySupport": {
"sponsor": ["skip", "mute"], "sponsor": ["skip", "mute"],
"selfpromo": ["skip", "mute"], "selfpromo": ["skip", "mute"],
@@ -11,6 +11,7 @@
"outro": ["skip"], "outro": ["skip"],
"preview": ["skip"], "preview": ["skip"],
"music_offtopic": ["skip"], "music_offtopic": ["skip"],
"poi_highlight": ["skip"] "poi_highlight": ["skip"],
"chapter": ["chapter"]
} }
} }

View File

@@ -365,9 +365,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
} }
} }
sponsorTimesSubmitting[this.props.index].category = this.categoryOptionRef.current.value as Category; const category = this.categoryOptionRef.current.value as Category
sponsorTimesSubmitting[this.props.index].category = category;
sponsorTimesSubmitting[this.props.index].actionType = sponsorTimesSubmitting[this.props.index].actionType =
this.actionTypeOptionRef?.current ? this.actionTypeOptionRef.current.value as ActionType : ActionType.Skip; this.actionTypeOptionRef?.current ? this.actionTypeOptionRef.current.value as ActionType
: CompileConfig.categorySupport[category];
Config.config.segmentTimes.set(this.props.contentContainer().sponsorVideoID, sponsorTimesSubmitting); Config.config.segmentTimes.set(this.props.contentContainer().sponsorVideoID, sponsorTimesSubmitting);