Skip to content

Commit b3bdec2

Browse files
Merge pull request #527 from AndreWohnsland/dev
Fix multiple added list config sharing value
2 parents a444eb3 + 3b27bd1 commit b3bdec2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web_client/src/components/options/ConfigWindow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ const ConfigWindow: React.FC = () => {
224224
const handleAddItem = (key: string, defaultValue: PossibleConfigValue) => {
225225
setConfigData((prevData) => {
226226
const currentValue = prevData[key];
227-
const newValue = Array.isArray(currentValue) ? [...currentValue, defaultValue] : [defaultValue];
227+
const clonedDefault = structuredClone(defaultValue);
228+
const newValue = Array.isArray(currentValue) ? [...currentValue, clonedDefault] : [clonedDefault];
228229
return {
229230
...prevData,
230231
[key]: newValue,

0 commit comments

Comments
 (0)