feat: add viewer preference for auto-marking articles as read and implement click/scroll-based read detection logic
This commit is contained in:
+10
-2
@@ -121,11 +121,19 @@ export const App: React.FC = () => {
|
||||
search: filter.search,
|
||||
limit: 100,
|
||||
});
|
||||
setEntries(res.entries);
|
||||
setEntries((prev) => {
|
||||
if (filter.view === 'inbox' && selectedEntryId) {
|
||||
const currentActive = prev.find((e) => e.id === selectedEntryId);
|
||||
if (currentActive && !res.entries.some((e) => e.id === selectedEntryId)) {
|
||||
return [currentActive, ...res.entries];
|
||||
}
|
||||
}
|
||||
return res.entries;
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Failed to load entries:', err);
|
||||
}
|
||||
}, [currentUser, filter]);
|
||||
}, [currentUser, filter, selectedEntryId]);
|
||||
|
||||
// Initial load
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user