Skip to content

Commit 4519b71

Browse files
fix: auto apply old request (#2583)
1 parent e780252 commit 4519b71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/web/client/src/app/project/[id]/_hooks/use-start-project.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ export const useStartProject = () => {
1616
const [error, setError] = useState<string | null>(null);
1717

1818
const { tabState } = useTabActive();
19+
const apiUtils = api.useUtils();
1920
const { data: user, isLoading: isUserLoading, error: userError } = api.user.get.useQuery();
2021
const { data: project, isLoading: isProjectLoading, error: projectError } = api.project.get.useQuery({ projectId: editorEngine.projectId });
2122
const { data: canvasWithFrames, isLoading: isCanvasLoading, error: canvasError } = api.canvas.getWithFrames.useQuery({ projectId: editorEngine.projectId });
2223
const { data: conversations, isLoading: isConversationsLoading, error: conversationsError } = api.chat.conversation.get.useQuery({ projectId: editorEngine.projectId });
2324
const { data: creationRequest, isLoading: isCreationRequestLoading, error: creationRequestError } = api.project.createRequest.getPendingRequest.useQuery({ projectId: editorEngine.projectId });
24-
const { mutateAsync: updateCreateRequest } = api.project.createRequest.updateStatus.useMutation();
25+
const { mutateAsync: updateCreateRequest } = api.project.createRequest.updateStatus.useMutation({
26+
onSettled: async () => {
27+
await apiUtils.project.createRequest.getPendingRequest.invalidate({ projectId: editorEngine.projectId });
28+
},
29+
});
2530

2631
const { sendMessages } = useChatContext();
2732

0 commit comments

Comments
 (0)