feat(mobile): entry list scroll to top for unreadonly switching
This commit is contained in:
parent
24834f5d05
commit
9d64dbbf92
|
|
@ -2,6 +2,7 @@ import { FeedViewType } from "@follow/constants"
|
|||
import type { FlashList } from "@shopify/flash-list"
|
||||
import { useEffect } from "react"
|
||||
|
||||
import { useGeneralSettingKey } from "@/src/atoms/settings/general"
|
||||
import { NoLoginInfo } from "@/src/components/common/NoLoginInfo"
|
||||
import { useRegisterNavigationScrollView } from "@/src/components/layouts/tabbar/hooks"
|
||||
import { EntryListContentPicture } from "@/src/modules/entry-list/EntryListContentPicture"
|
||||
|
|
@ -49,6 +50,13 @@ export function EntryListSelector({
|
|||
}
|
||||
}
|
||||
|
||||
const unreadOnly = useGeneralSettingKey("unreadOnly")
|
||||
useEffect(() => {
|
||||
ref?.current?.scrollToOffset({
|
||||
offset: 0,
|
||||
})
|
||||
}, [unreadOnly, ref])
|
||||
|
||||
const { isRefetching } = useFetchEntriesControls()
|
||||
useEffect(() => {
|
||||
if (isRefetching) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue