feat(canvas): add loading state for agent history retrieval
This commit is contained in:
@@ -2682,6 +2682,7 @@ export function CanvasWorkspace({ projectId, shareAccess = ownerWorkspaceAccess
|
||||
setAgentHistoryOpen(false);
|
||||
const currentProject = projectRef.current;
|
||||
if (currentProject) {
|
||||
setAgentHistoryLoading(true);
|
||||
setMessages(visibleAgentMessagesForThread(currentProject, imageGeneratorThreadIdsRef.current, threadId));
|
||||
void designGateway
|
||||
.getProjectHistory(currentProject.id, threadId)
|
||||
@@ -2698,6 +2699,9 @@ export function CanvasWorkspace({ projectId, shareAccess = ownerWorkspaceAccess
|
||||
})
|
||||
.catch((err) => {
|
||||
console.warn("Failed to load agent thread history", err);
|
||||
})
|
||||
.finally(() => {
|
||||
if (selectedAgentThreadIdRef.current === threadId) setAgentHistoryLoading(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user