chore: using refetchQueries instead of invalidateQueries

This commit is contained in:
d-kimsuon
2025-10-15 03:47:09 +09:00
parent d322db543c
commit f34943c9cc
3 changed files with 5 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ export const ProjectPageContent = ({ projectId }: { projectId: string }) => {
// biome-ignore lint/correctness/useExhaustiveDependencies: invalidate when config changed
useEffect(() => {
void queryClient.invalidateQueries({
void queryClient.refetchQueries({
queryKey: ["projects", projectId],
});
}, [config.hideNoUserMessageSession, config.unifySameTitleSession]);

View File

@@ -37,13 +37,13 @@ export const SettingsControls: FC<SettingsControlsProps> = ({
const queryClient = useQueryClient();
const onConfigChanged = useCallback(async () => {
await queryClient.invalidateQueries({
await queryClient.refetchQueries({
queryKey: configQuery.queryKey,
});
await queryClient.invalidateQueries({
await queryClient.refetchQueries({
queryKey: projectListQuery.queryKey,
});
void queryClient.invalidateQueries({
void queryClient.refetchQueries({
queryKey: projectDetailQuery(openingProjectId).queryKey,
});
}, [queryClient, openingProjectId]);

View File

@@ -18,9 +18,7 @@ export const projectListQuery = {
export const projectDetailQuery = (projectId: string, cursor?: string) =>
({
queryKey: cursor
? ["projects", projectId, cursor]
: ["projects", projectId],
queryKey: ["projects", projectId],
queryFn: async () => {
const response = await honoClient.api.projects[":projectId"].$get({
param: { projectId },