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:
parent
148e057ddd
commit
1553751287
1 changed files with 7 additions and 4 deletions
|
@ -89,8 +89,9 @@ export function SettingArrayComponent({
|
|||
pluginSettings[id] = [];
|
||||
return;
|
||||
}
|
||||
setItems(items.filter((_, i) => i !== index));
|
||||
pluginSettings[id] = items;
|
||||
const newItems = items.filter((_, i) => i !== index);
|
||||
setItems(newItems);
|
||||
pluginSettings[id] = newItems;
|
||||
};
|
||||
|
||||
function renderGuildView() {
|
||||
|
@ -253,9 +254,11 @@ export function SettingArrayComponent({
|
|||
return;
|
||||
}
|
||||
|
||||
setItems([...items, inputElement.value]);
|
||||
const newItems = [...items, inputElement.value];
|
||||
|
||||
pluginSettings[id] = items;
|
||||
setItems(newItems);
|
||||
|
||||
pluginSettings[id] = newItems;
|
||||
inputElement.value = "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue