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
|
||||
useEffect(() => {
|
||||
void queryClient.invalidateQueries({
|
||||
void queryClient.refetchQueries({
|
||||
queryKey: ["projects", projectId],
|
||||
});
|
||||
}, [config.hideNoUserMessageSession, config.unifySameTitleSession]);
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user