Skip to content

Commit

Permalink
Fixed duplicate keus
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-oki committed Nov 25, 2024
1 parent f6b520b commit e3009f7
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions frontend/src/pages/Settings/Providers/components.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Fragment,
FunctionComponent,
useCallback,
useMemo,
Expand Down Expand Up @@ -288,52 +289,48 @@ const ProviderTool: FunctionComponent<ProviderToolProps> = ({
switch (value.type) {
case "text":
elements.push(
<>
<Fragment key={BuildKey(itemKey, key)}>
<Text
key={BuildKey(itemKey, key)}
label={label}
settingKey={`settings-${itemKey}-${key}`}
></Text>
{error}
</>,
</Fragment>,
);
return;
case "password":
elements.push(
<>
<Fragment key={BuildKey(itemKey, key)}>
<Password
key={BuildKey(itemKey, key)}
label={label}
settingKey={`settings-${itemKey}-${key}`}
></Password>
{error}
</>,
</Fragment>,
);
return;
case "switch":
elements.push(
<>
<Fragment key={BuildKey(itemKey, key)}>
<Check
key={key}
inline
label={label}
settingKey={`settings-${itemKey}-${key}`}
></Check>
{error}
</>,
</Fragment>,
);
return;
case "select":
elements.push(
<>
<Fragment key={BuildKey(itemKey, key)}>
<GlobalSelector
key={key}
label={label}
settingKey={`settings-${itemKey}-${key}`}
options={options}
></GlobalSelector>
{error}
</>,
</Fragment>,
);
return;
case "testbutton":
Expand All @@ -343,14 +340,13 @@ const ProviderTool: FunctionComponent<ProviderToolProps> = ({
return;
case "chips":
elements.push(
<>
<Fragment key={BuildKey(itemKey, key)}>
<Chips
key={key}
label={label}
settingKey={`settings-${itemKey}-${key}`}
></Chips>
{error}
</>,
</Fragment>,
);
return;
default:
Expand Down

0 comments on commit e3009f7

Please sign in to comment.