From b1c61d2846d13ae5ccdcde4baefeab1f411bc255 Mon Sep 17 00:00:00 2001 From: Flashy78 <90150289+Flashy78@users.noreply.github.com> Date: Wed, 3 May 2023 21:13:35 -0700 Subject: [PATCH] Identify: Select existing value on edit (#3696) * Select field option on edit * Fix create missing display --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com> --- .../Dialogs/IdentifyDialog/FieldOptions.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ui/v2.5/src/components/Dialogs/IdentifyDialog/FieldOptions.tsx b/ui/v2.5/src/components/Dialogs/IdentifyDialog/FieldOptions.tsx index ba027cd5c..68a31fe6b 100644 --- a/ui/v2.5/src/components/Dialogs/IdentifyDialog/FieldOptions.tsx +++ b/ui/v2.5/src/components/Dialogs/IdentifyDialog/FieldOptions.tsx @@ -96,17 +96,13 @@ const FieldOptionsEditor: React.FC = ({ }); } - if (!localOptions) { - return <>; - } - return ( {allowSetDefault ? ( setLocalOptions({ ...localOptions, @@ -122,7 +118,7 @@ const FieldOptionsEditor: React.FC = ({ type="radio" key={f[0]} id={`${field}-strategy-${f[0]}`} - checked={localOptions.strategy === f[1]} + checked={strategy === f[1]} onChange={() => setLocalOptions({ ...localOptions, @@ -168,7 +164,9 @@ const FieldOptionsEditor: React.FC = ({ (f) => f.field === localOptions.field )?.createMissing; - if (localOptions.strategy === undefined) { + // if allowSetDefault is false, then strategy is considered merge + // if its true, then its using the default value and should not be shown here + if (localOptions.strategy === undefined && allowSetDefault) { return; }