File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
apps/mobile/src/modules/entry-list Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export function useOnViewableItemsChanged({
12
12
} : {
13
13
idExtractor ?: ( item : ViewToken ) => string
14
14
} = { } ) {
15
- const orientation = useRef < "down" | "up" > ( "down " )
15
+ const orientation = useRef < "down" | "up" | "initial" > ( "initial " )
16
16
const lastOffset = useRef ( 0 )
17
17
18
18
const markAsReadWhenScrolling = useGeneralSettingKey ( "scrollMarkUnread" )
@@ -26,15 +26,17 @@ export function useOnViewableItemsChanged({
26
26
} ) => void = useNonReactiveCallback ( ( { viewableItems, changed } ) => {
27
27
debouncedFetchEntryContentByStream ( viewableItems . map ( ( item ) => stableIdExtractor ( item ) ) )
28
28
29
- if ( markAsReadWhenScrolling && orientation . current === "down" ) {
29
+ if ( orientation . current !== "down" ) return
30
+
31
+ if ( markAsReadWhenScrolling ) {
30
32
changed
31
33
. filter ( ( item ) => ! item . isViewable )
32
34
. forEach ( ( item ) => {
33
35
unreadSyncService . markEntryAsRead ( stableIdExtractor ( item ) )
34
36
} )
35
37
}
36
38
37
- if ( markAsReadWhenRendering && orientation . current === "down" ) {
39
+ if ( markAsReadWhenRendering ) {
38
40
viewableItems . forEach ( ( item ) => {
39
41
unreadSyncService . markEntryAsRead ( stableIdExtractor ( item ) )
40
42
} )
You can’t perform that action at this time.
0 commit comments