mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2025-12-20 23:04:19 +01:00
chore: using refetchQueries instead of invalidateQueries
This commit is contained in:
@@ -47,7 +47,7 @@ export const ProjectPageContent = ({ projectId }: { projectId: string }) => {
|
|||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: invalidate when config changed
|
// biome-ignore lint/correctness/useExhaustiveDependencies: invalidate when config changed
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void queryClient.invalidateQueries({
|
void queryClient.refetchQueries({
|
||||||
queryKey: ["projects", projectId],
|
queryKey: ["projects", projectId],
|
||||||
});
|
});
|
||||||
}, [config.hideNoUserMessageSession, config.unifySameTitleSession]);
|
}, [config.hideNoUserMessageSession, config.unifySameTitleSession]);
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ export const SettingsControls: FC<SettingsControlsProps> = ({
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const onConfigChanged = useCallback(async () => {
|
const onConfigChanged = useCallback(async () => {
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.refetchQueries({
|
||||||
queryKey: configQuery.queryKey,
|
queryKey: configQuery.queryKey,
|
||||||
});
|
});
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.refetchQueries({
|
||||||
queryKey: projectListQuery.queryKey,
|
queryKey: projectListQuery.queryKey,
|
||||||
});
|
});
|
||||||
void queryClient.invalidateQueries({
|
void queryClient.refetchQueries({
|
||||||
queryKey: projectDetailQuery(openingProjectId).queryKey,
|
queryKey: projectDetailQuery(openingProjectId).queryKey,
|
||||||
});
|
});
|
||||||
}, [queryClient, openingProjectId]);
|
}, [queryClient, openingProjectId]);
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ export const projectListQuery = {
|
|||||||
|
|
||||||
export const projectDetailQuery = (projectId: string, cursor?: string) =>
|
export const projectDetailQuery = (projectId: string, cursor?: string) =>
|
||||||
({
|
({
|
||||||
queryKey: cursor
|
queryKey: ["projects", projectId],
|
||||||
? ["projects", projectId, cursor]
|
|
||||||
: ["projects", projectId],
|
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const response = await honoClient.api.projects[":projectId"].$get({
|
const response = await honoClient.api.projects[":projectId"].$get({
|
||||||
param: { projectId },
|
param: { projectId },
|
||||||
|
|||||||
Reference in New Issue
Block a user