aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim <[email protected]>2021-08-15 02:42:47 +0500
committerGitHub <[email protected]>2021-08-15 02:42:47 +0500
commit1bd78ec1c4cdac5a0f6d11419a3317f01744a543 (patch)
treeac1365ed1dcd099b00ac148985b8759591b48f63
parentf01a1ae4ec34005f69dfb2bbb382099f9006d42f (diff)
downloadSponsorBlock-1bd78ec1c4cdac5a0f6d11419a3317f01744a543.tar.gz
SponsorBlock-1bd78ec1c4cdac5a0f6d11419a3317f01744a543.zip
Fix for an "enable category" popup
If you choose any category when editing a segment, and then choose the "Choose a category" one, it triggers the enable category message with an empty category name. This is a fix for that.
-rw-r--r--src/components/SponsorTimeEditComponent.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 483ddbae..3de70141 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -239,7 +239,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
categorySelectionChange(event: React.ChangeEvent<HTMLSelectElement>): void {
// See if show more categories was pressed
- if (!Config.config.categorySelections.some((category) => category.name === event.target.value)) {
+ if (event.target.value !== DEFAULT_CATEGORY && !Config.config.categorySelections.some((category) => category.name === event.target.value)) {
const chosenCategory = event.target.value;
event.target.value = DEFAULT_CATEGORY;
@@ -369,4 +369,4 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
}
-export default SponsorTimeEditComponent; \ No newline at end of file
+export default SponsorTimeEditComponent;