fix: harden persistence checks and export timeout

This commit is contained in:
dayuan.jiang
2026-01-25 14:33:20 +09:00
parent 384221c498
commit 7525253499
3 changed files with 26 additions and 13 deletions

View File

@@ -144,17 +144,15 @@ export default function ChatPanel({
handleExportWithoutHistory()
}
}),
new Promise<string>((_, reject) =>
setTimeout(
() =>
reject(
new Error(
"Chart export timed out after 10 seconds",
),
),
10000,
),
),
new Promise<string>((_, reject) => {
const currentResolver = resolverRef.current
setTimeout(() => {
if (resolverRef.current === currentResolver) {
resolverRef.current = null
}
reject(new Error("Chart export timed out after 10 seconds"))
}, 10000)
}),
])
}