このコミットが含まれているのは:
2026-10-29 23:31:04 +09:00
コミット efbd640963
8個のファイルの変更、201行の追加、19行の削除
+6 -3
ファイルの表示
@@ -219,7 +219,8 @@ export const startAPIDownload = (
path: string,
token: string,
onError?: () => void,
): void => {
query?: URLSearchParams,
): (() => void) => {
const frame = document.createElement ('iframe')
frame.hidden = true
frame.addEventListener ('load', () => {
@@ -231,8 +232,10 @@ export const startAPIDownload = (
}
})
frame.addEventListener ('error', () => { onError?.(); frame.remove () })
frame.src = `${API_BASE_URL}${path}/files/${encodeURIComponent (token)}`
const suffix = query == null ? '' : `?${query.toString ()}`
frame.src = `${API_BASE_URL}${path}/files/${encodeURIComponent (token)}${suffix}`
document.body.append (frame)
// Attachments do not reliably fire load; keep this isolated from page navigation.
window.setTimeout (() => frame.remove (), 10 * 60_000)
const timer = window.setTimeout (() => frame.remove (), 10 * 60_000)
return () => { window.clearTimeout (timer); frame.remove () }
}