diff --git a/static/app.js b/static/app.js index 6b5d573..ff0f0fd 100644 --- a/static/app.js +++ b/static/app.js @@ -174,13 +174,11 @@ function getPdfLink(p) { function openPdfBtn(btn) { openPdf(btn.dataset.pdf, btn.dataset.title); } -async function openTrans(btn) { +function openTrans(btn) { const url = btn.dataset.pdf; - try { - const resp = await fetch(url, { method: 'HEAD' }); - if (resp.ok) { openPdf(url, btn.dataset.title); return; } - } catch(e) {} - alert('该论文译文尚未生成,请稍后再试'); + const title = btn.dataset.title; + openPdf(url, title); + // If translation doesn't exist, the iframe will show error - user can see it } // ═══════════════ PDF VIEWER (状态条驱动) ═══════════════ diff --git a/static/index.html b/static/index.html index 0e6a2e4..a4c8337 100644 --- a/static/index.html +++ b/static/index.html @@ -207,13 +207,11 @@ function getPdfLink(p) { function openPdfBtn(btn) { openPdf(btn.dataset.pdf, btn.dataset.title); } -async function openTrans(btn) { +function openTrans(btn) { const url = btn.dataset.pdf; - try { - const resp = await fetch(url, { method: 'HEAD' }); - if (resp.ok) { openPdf(url, btn.dataset.title); return; } - } catch(e) {} - alert('该论文译文尚未生成,请稍后再试'); + const title = btn.dataset.title; + openPdf(url, title); + // If translation doesn't exist, the iframe will show error - user can see it } // ═══════════════ PDF VIEWER (状态条驱动) ═══════════════