Skip to content

Commit 4ee7236

Browse files
committed
fix: show custom feed title, close #4177
1 parent ee52eec commit 4ee7236

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/mobile/src/modules/screen/atoms.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useFeedById } from "@follow/store/feed/hooks"
2020
import { useInboxById } from "@follow/store/inbox/hooks"
2121
import { useListById } from "@follow/store/list/hooks"
2222
import { getSubscriptionByCategory } from "@follow/store/subscription/getter"
23-
import { useViewWithSubscription } from "@follow/store/subscription/hooks"
23+
import { useSubscriptionByFeedId, useViewWithSubscription } from "@follow/store/subscription/hooks"
2424
import { jotaiStore } from "@follow/utils"
2525
import { EventBus } from "@follow/utils/event-bus"
2626
import { debounce } from "es-toolkit"
@@ -345,6 +345,9 @@ export const useSelectedFeedTitle = () => {
345345
selectedFeed && selectedFeed.type === "view" ? selectedFeed.viewId : undefined,
346346
)
347347
const feed = useFeedById(selectedFeed && selectedFeed.type === "feed" ? selectedFeed.feedId : "")
348+
const feedSubscription = useSubscriptionByFeedId(
349+
selectedFeed && selectedFeed.type === "feed" ? selectedFeed.feedId : "",
350+
)
348351
const list = useListById(selectedFeed && selectedFeed.type === "list" ? selectedFeed.listId : "")
349352
const inbox = useInboxById(
350353
selectedFeed && selectedFeed.type === "inbox" ? selectedFeed.inboxId : "",
@@ -360,7 +363,9 @@ export const useSelectedFeedTitle = () => {
360363
return viewDef?.name ? t(viewDef.name) : ""
361364
}
362365
case "feed": {
363-
return selectedFeed.feedId === FEED_COLLECTION_LIST ? t("words.starred") : (feed?.title ?? "")
366+
return selectedFeed.feedId === FEED_COLLECTION_LIST
367+
? t("words.starred")
368+
: feedSubscription?.title || feed?.title || ""
364369
}
365370
case "category": {
366371
return selectedFeed.categoryName

0 commit comments

Comments
 (0)