mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Queue not always clearing checked items when updated
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
15
frontend/src/Utilities/Object/getRemovedItems.js
Normal file
15
frontend/src/Utilities/Object/getRemovedItems.js
Normal file
@@ -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;
|
Reference in New Issue
Block a user