From 7a95a159f7caaaba9842593895aeb41ed2e345a9 Mon Sep 17 00:00:00 2001
From: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
Date: Tue, 8 Jul 2025 17:20:02 +0800
Subject: [PATCH] fix: persist rsshub and trending query
---
apps/desktop/layer/renderer/src/modules/trending/index.tsx | 3 +++
.../desktop/layer/renderer/src/modules/user/UserAvatar.tsx | 7 ++++---
.../(layer)/(subview)/discover/category/[category].tsx | 6 ++++++
.../src/pages/(main)/(layer)/(subview)/rsshub/index.tsx | 2 +-
4 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/apps/desktop/layer/renderer/src/modules/trending/index.tsx b/apps/desktop/layer/renderer/src/modules/trending/index.tsx
index ed822a165..b5c561446 100644
--- a/apps/desktop/layer/renderer/src/modules/trending/index.tsx
+++ b/apps/desktop/layer/renderer/src/modules/trending/index.tsx
@@ -69,6 +69,9 @@ export function Trending({
},
})
},
+ meta: {
+ persist: true,
+ },
})
useEffect(() => {
diff --git a/apps/desktop/layer/renderer/src/modules/user/UserAvatar.tsx b/apps/desktop/layer/renderer/src/modules/user/UserAvatar.tsx
index aea3cad7e..dc4271b80 100644
--- a/apps/desktop/layer/renderer/src/modules/user/UserAvatar.tsx
+++ b/apps/desktop/layer/renderer/src/modules/user/UserAvatar.tsx
@@ -1,5 +1,5 @@
import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx"
-import { usePrefetchUser, useWhoami } from "@follow/store/user/hooks"
+import { usePrefetchUser, useUserById, useWhoami } from "@follow/store/user/hooks"
import { getColorScheme, stringToHue } from "@follow/utils/color"
import { cn } from "@follow/utils/utils"
@@ -34,13 +34,14 @@ export const UserAvatar = ({
const whoami = useWhoami()
const presentUserProfile = usePresentUserProfileModal("drawer")
- const profile = usePrefetchUser(userId)
+ usePrefetchUser(userId)
+ const profile = useUserById(userId)
if (!userId && status !== "authenticated") {
return