From e48d95657728bcb8bf00b58d18b36714bffc8f43 Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 3 Jul 2022 22:44:32 -0400 Subject: [PATCH] Fix segments disapearing when changing skip options --- .../CategorySkipOptionsComponent.tsx | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/CategorySkipOptionsComponent.tsx b/src/components/CategorySkipOptionsComponent.tsx index 905c3b3d..fbbcc256 100644 --- a/src/components/CategorySkipOptionsComponent.tsx +++ b/src/components/CategorySkipOptionsComponent.tsx @@ -111,8 +111,6 @@ class CategorySkipOptionsComponent extends React.Component): void { let option: CategorySkipOption; - this.removeCurrentCategorySelection(); - switch (event.target.value) { case "disable": return; @@ -130,28 +128,17 @@ class CategorySkipOptionsComponent extends React.Component selection.name === this.props.category); + if (existingSelection) { + existingSelection.option = option; + } else { + Config.config.categorySelections.push({ + name: this.props.category, + option: option + }); } + + Config.forceSyncUpdate("categorySelections"); } getCategorySkipOptions(): JSX.Element[] {