diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index 693a7d53..b5d491a5 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -252,7 +252,6 @@ export function usePinnedFeedsInfos(): FeedSourceInfo[] { FOLLOWING_FEED_STUB, ]) const {data: preferences} = usePreferencesQuery() - const pinnedFeedsKey = JSON.stringify(preferences?.feeds?.pinned) React.useEffect(() => { if (!preferences?.feeds?.pinned) return @@ -299,13 +298,7 @@ export function usePinnedFeedsInfos(): FeedSourceInfo[] { } fetchFeedInfo() - }, [ - queryClient, - setTabs, - preferences?.feeds?.pinned, - // ensure we react to re-ordering - pinnedFeedsKey, - ]) + }, [queryClient, setTabs, preferences?.feeds?.pinned]) return tabs } diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 476c69fc..e5a3035a 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -57,9 +57,7 @@ function HomeScreenReady({ } } return feeds - // TODO careful, needed to disabled this -esb - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [preferences.feeds.pinned, pinnedFeedOrderKey]) + }, [preferences.feeds.pinned]) const homeFeedParams = React.useMemo(() => { return { diff --git a/src/view/screens/SavedFeeds.tsx b/src/view/screens/SavedFeeds.tsx index 640d76a5..ce668877 100644 --- a/src/view/screens/SavedFeeds.tsx +++ b/src/view/screens/SavedFeeds.tsx @@ -185,7 +185,8 @@ function ListItem({ queryClient.getQueryData( preferencesQueryKey, )?.feeds - const pinned = feeds?.pinned ?? [] + // create new array, do not mutate + const pinned = feeds?.pinned ? [...feeds.pinned] : [] const index = pinned.indexOf(feedUri) if (index === -1 || index === 0) return @@ -210,7 +211,8 @@ function ListItem({ queryClient.getQueryData( preferencesQueryKey, )?.feeds - const pinned = feeds?.pinned ?? [] + // create new array, do not mutate + const pinned = feeds?.pinned ? [...feeds.pinned] : [] const index = pinned.indexOf(feedUri) if (index === -1 || index >= pinned.length - 1) return