Fixed: Queue not always clearing checked items when updated

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Qstick
2020-10-02 22:07:27 -04:00
committed by nitsua
parent 4247605dc9
commit 2f56814f58
2 changed files with 33 additions and 22 deletions
@@ -0,0 +1,15 @@
function getRemovedItems(prevItems, currentItems, idProp = 'id') {
if (prevItems === currentItems) {
return [];
}
const currentItemIds = new Set();
currentItems.forEach((currentItem) => {
currentItemIds.add(currentItem[idProp]);
});
return prevItems.filter((prevItem) => !currentItemIds.has(prevItem[idProp]));
}
export default getRemovedItems;