1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

ensure value gets updated correctly

This commit is contained in:
Elvy 2025-01-04 18:31:15 +01:00
parent 148e057ddd
commit 1553751287

View file

@ -89,8 +89,9 @@ export function SettingArrayComponent({
pluginSettings[id] = []; pluginSettings[id] = [];
return; return;
} }
setItems(items.filter((_, i) => i !== index)); const newItems = items.filter((_, i) => i !== index);
pluginSettings[id] = items; setItems(newItems);
pluginSettings[id] = newItems;
}; };
function renderGuildView() { function renderGuildView() {
@ -253,9 +254,11 @@ export function SettingArrayComponent({
return; return;
} }
setItems([...items, inputElement.value]); const newItems = [...items, inputElement.value];
pluginSettings[id] = items; setItems(newItems);
pluginSettings[id] = newItems;
inputElement.value = ""; inputElement.value = "";
} }