diff --git a/src/state/queries/app-passwords.ts b/src/state/queries/app-passwords.ts index e79a2607..9aadfe2e 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 ef3c955a..ae932462 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 b9bb91a2..7ab29d18 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 2270e722..c31afe01 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 c15ee574..5a83bee2 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 7e996c12..0b049e65 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 c4408a04..c46474b2 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 f6ce20ee..48307643 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 c30a2c04..4e7890e3 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 69316862..9f803306 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 b9d95c29..71c51993 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 f24c5785..919ac115 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 a2418a0c..7e443028 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 275450b9..b5bf920b 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({