Closes #114 fix crash on item addition

This commit is contained in:
Jeremie Pardou-Piquemal 2020-07-17 14:40:00 +02:00 committed by Jérémie Pardou-Piquemal
parent 7b847b9a05
commit f409d15de9

View file

@ -46,7 +46,9 @@ export const SubcribeItemEvents = () => {
return prev; return prev;
}, {}); }, {});
const result = prevList.map((item, index) => { const result = prevList.map((item, index) => {
return itemsMap[itemIds[index]]; // Fix #114 crash when pushing new item and receive update list order
// If item id doesn't exists in map, we keep the current item
return itemsMap[itemIds[index]] || item;
}); });
return result; return result;
}); });