MCPcopy Create free account
hub / github.com/ResearAI/AutoFigure / onFetchChart

Function onFetchChart

frontend/components/chat-panel.tsx:110–134  ·  view source on GitHub ↗
(saveToHistory = true)

Source from the content-addressed store, hash-verified

108 } = useDiagram()
109
110 const onFetchChart = (saveToHistory = true) => {
111 return Promise.race([
112 new Promise<string>((resolve) => {
113 if (resolverRef && "current" in resolverRef) {
114 resolverRef.current = resolve
115 }
116 if (saveToHistory) {
117 onExport()
118 } else {
119 handleExportWithoutHistory()
120 }
121 }),
122 new Promise<string>((_, reject) =>
123 setTimeout(
124 () =>
125 reject(
126 new Error(
127 "Chart export timed out after 10 seconds",
128 ),
129 ),
130 10000,
131 ),
132 ),
133 ])
134 }
135
136 // File processing using extracted hook
137 const { files, pdfData, handleFileChange, setFiles } = useFileProcessor()

Callers 2

onToolCallFunction · 0.85
onFormSubmitFunction · 0.85

Calls 1

Tested by

no test coverage detected