Skip to content

Commit

Permalink
Improve item disappearing when read it on Unread page
Browse files Browse the repository at this point in the history
  • Loading branch information
parksb committed Apr 30, 2024
1 parent 32cfdbc commit fed35a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ function Items(props: Props) {
const ids = targets.filter(x => x.status !== status).map(x => x.id);
if (ids.length) {
await api.markAs(ids, status);
await loadItems();
if (props.type === ItemType.UNREAD) {
setItems(items().map(x => ids.includes(x.id) ? { ...x, status: status } : x));
setCount(await api.countItems(opt()));
} else {
await loadItems();
}
}
};

Expand Down

0 comments on commit fed35a6

Please sign in to comment.