fixes event update to store

This commit is contained in:
arpitnath 2023-08-24 19:18:24 +05:30
parent 30d0bd4912
commit cbaca9b8cb

View file

@ -60,8 +60,9 @@ export const useAppDataStore = create(
const updatedEvents = get().events;
updatedEvents.forEach((e, index) => {
if (e.id === response[index].id) {
updatedEvents[index] = response[index];
const toUpdate = response.find((r) => r.id === e.id);
if (toUpdate) {
updatedEvents[index] = toUpdate;
}
});