1
0

fix bug when removing process from list

This commit is contained in:
Rokas Puzonas 2023-04-17 21:07:40 +03:00
parent 838830d2e6
commit 1b4a7f3612

View File

@ -37,6 +37,13 @@
processess = newProcessess processess = newProcessess
selectedAdd = getAvailableProcessess()[0] selectedAdd = getAvailableProcessess()[0]
} }
function removeRow(id) {
processess = processess.filter(row => row != id)
if (selectedAdd == undefined) {
selectedAdd = getAvailableProcessess()[0]
}
}
</script> </script>
<div> <div>
@ -52,9 +59,7 @@
icon={TrashCan} icon={TrashCan}
iconDescription="Delete" iconDescription="Delete"
kind="danger-tertiary" kind="danger-tertiary"
on:click={() => { on:click={() => removeRow(id)}
processess = processess.filter(row => row != id)
}}
/> />
</div> </div>
{/each} {/each}