diff --git a/src/state/queries/app-passwords.ts b/src/state/queries/app-passwords.ts index e79a26077c..9aadfe2e49 100644 --- a/src/state/queries/app-passwords.ts +++ b/src/state/queries/app-passwords.ts @@ -9,7 +9,7 @@ export const RQKEY = () => ['app-passwords'] export function useAppPasswordsQuery() { const {agent} = useSession() return useQuery({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(), queryFn: async () => { const res = await agent.com.atproto.server.listAppPasswords({}) diff --git a/src/state/queries/list-members.ts b/src/state/queries/list-members.ts index ef3c955ad0..ae932462d5 100644 --- a/src/state/queries/list-members.ts +++ b/src/state/queries/list-members.ts @@ -18,7 +18,7 @@ export function useListMembersQuery(uri: string) { QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(uri), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.graph.getList({ diff --git a/src/state/queries/list-memberships.ts b/src/state/queries/list-memberships.ts index b9bb91a24d..7ab29d180e 100644 --- a/src/state/queries/list-memberships.ts +++ b/src/state/queries/list-memberships.ts @@ -40,7 +40,7 @@ export interface ListMembersip { export function useDangerousListMembershipsQuery() { const {agent, currentAccount} = useSession() return useQuery({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.FIVE, queryKey: RQKEY(), async queryFn() { if (!currentAccount) { diff --git a/src/state/queries/list.ts b/src/state/queries/list.ts index 2270e722cb..c31afe01b6 100644 --- a/src/state/queries/list.ts +++ b/src/state/queries/list.ts @@ -20,7 +20,7 @@ export const RQKEY = (uri: string) => ['list', uri] export function useListQuery(uri?: string) { const {agent} = useSession() return useQuery({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(uri || ''), async queryFn() { if (!uri) { diff --git a/src/state/queries/my-blocked-accounts.ts b/src/state/queries/my-blocked-accounts.ts index c15ee57450..5a83bee2c7 100644 --- a/src/state/queries/my-blocked-accounts.ts +++ b/src/state/queries/my-blocked-accounts.ts @@ -16,7 +16,7 @@ export function useMyBlockedAccountsQuery() { QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.graph.getBlocks({ diff --git a/src/state/queries/my-lists.ts b/src/state/queries/my-lists.ts index 7e996c12c9..0b049e65f9 100644 --- a/src/state/queries/my-lists.ts +++ b/src/state/queries/my-lists.ts @@ -11,7 +11,7 @@ export const RQKEY = (filter: MyListsFilter) => ['my-lists', filter] export function useMyListsQuery(filter: MyListsFilter) { const {agent, currentAccount} = useSession() return useQuery({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(filter), async queryFn() { let lists: AppBskyGraphDefs.ListView[] = [] diff --git a/src/state/queries/my-muted-accounts.ts b/src/state/queries/my-muted-accounts.ts index c4408a04e5..c46474b27e 100644 --- a/src/state/queries/my-muted-accounts.ts +++ b/src/state/queries/my-muted-accounts.ts @@ -16,7 +16,7 @@ export function useMyMutedAccountsQuery() { QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.graph.getMutes({ diff --git a/src/state/queries/preferences/index.ts b/src/state/queries/preferences/index.ts index f6ce20ee4e..483076431e 100644 --- a/src/state/queries/preferences/index.ts +++ b/src/state/queries/preferences/index.ts @@ -34,7 +34,7 @@ export function usePreferencesQuery() { const {agent, hasSession} = useSession() return useQuery({ enabled: hasSession, - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: usePreferencesQueryKey, queryFn: async () => { const res = await agent.getPreferences() diff --git a/src/state/queries/profile-extra-info.ts b/src/state/queries/profile-extra-info.ts index c30a2c0406..4e7890e324 100644 --- a/src/state/queries/profile-extra-info.ts +++ b/src/state/queries/profile-extra-info.ts @@ -13,7 +13,7 @@ export const RQKEY = (did: string) => ['profile-extra-info', did] export function useProfileExtraInfoQuery(did: string) { const {agent} = useSession() return useQuery({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(did), async queryFn() { const [listsRes, feedsRes] = await Promise.all([ diff --git a/src/state/queries/profile-feedgens.ts b/src/state/queries/profile-feedgens.ts index 693168625d..9f80330655 100644 --- a/src/state/queries/profile-feedgens.ts +++ b/src/state/queries/profile-feedgens.ts @@ -23,7 +23,7 @@ export function useProfileFeedgensQuery( QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(did), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.feed.getActorFeeds({ diff --git a/src/state/queries/profile-follows.ts b/src/state/queries/profile-follows.ts index b9d95c298f..71c51993d9 100644 --- a/src/state/queries/profile-follows.ts +++ b/src/state/queries/profile-follows.ts @@ -19,7 +19,7 @@ export function useProfileFollowsQuery(did: string | undefined) { QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(did || ''), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.graph.getFollows({ diff --git a/src/state/queries/profile-lists.ts b/src/state/queries/profile-lists.ts index f24c578582..919ac1153f 100644 --- a/src/state/queries/profile-lists.ts +++ b/src/state/queries/profile-lists.ts @@ -19,7 +19,7 @@ export function useProfileListsQuery(did: string, opts?: {enabled?: boolean}) { QueryKey, RQPageParam >({ - staleTime: STALE.INFINITY, + staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(did), async queryFn({pageParam}: {pageParam: RQPageParam}) { const res = await agent.app.bsky.graph.getLists({ diff --git a/src/state/queries/suggested-feeds.ts b/src/state/queries/suggested-feeds.ts index a2418a0c4b..7e443028d6 100644 --- a/src/state/queries/suggested-feeds.ts +++ b/src/state/queries/suggested-feeds.ts @@ -16,7 +16,7 @@ export function useSuggestedFeedsQuery() { QueryKey, string | undefined >({ - staleTime: STALE.INFINITY, + staleTime: STALE.HOURS.ONE, queryKey: suggestedFeedsQueryKey, queryFn: async ({pageParam}) => { const res = await agent.app.bsky.feed.getSuggestedFeeds({ diff --git a/src/state/queries/suggested-follows.ts b/src/state/queries/suggested-follows.ts index 275450b97b..b5bf920b31 100644 --- a/src/state/queries/suggested-follows.ts +++ b/src/state/queries/suggested-follows.ts @@ -34,7 +34,7 @@ export function useSuggestedFollowsQuery() { string | undefined >({ enabled: !!moderationOpts, - staleTime: STALE.INFINITY, + staleTime: STALE.HOURS.ONE, queryKey: suggestedFollowsQueryKey, queryFn: async ({pageParam}) => { const res = await agent.app.bsky.actor.getSuggestions({