Skip to content

Commit

Permalink
Fix useTodayScreen hook
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Oct 16, 2023
1 parent c4fe20f commit 7697b82
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions android/src/components/TodayScreen/hooks/useTodayScreen.ts
Expand Up @@ -118,15 +118,11 @@ async function handleScreenState(
checkListId: screenState.checkListId,
itemWithCheckeds: itemIds.reduce(
(acc, checkedItemId) => {
const item = acc.find((i) => i.id === checkedItemId);
if (item === undefined) return acc;
return {
...acc,
[checkedItemId]: {
...item,
checked: true,
},
};
return acc.map((item) => {
return item.id === checkedItemId
? { ...item, checked: true }
: item;
});
},
screenState.items.map((item) => ({ ...item, checked: false })),
),
Expand Down

0 comments on commit 7697b82

Please sign in to comment.