Checkpoint · code-edit

防止重複送出

只驗證本主題責任,不偷渡其他答案。

Checkpoint 要做什麼

只驗證本主題責任,不偷渡其他答案。

本主題檔案:files/main.js

定位:先把 attempts 與真正呼叫 transport 的 sendCount 分開記錄。

本階段驗收

頁面不會替你修改檔案;請在實作檔完成後重新整理確認。

目前要處理

按鈕可用、inFlight=false、sendCount=0。

預期看到

attempts=2、sendCount=1、disabledDuring=true、restored=true。

if (inFlight) return; inFlight=true; button.disabled=true; try { await send(); } finally { inFlight=false; button.disabled=false; }

檔案清單

只在本階段資料夾內操作,避免改到其他章節。

證據:attempts=2、sendCount=1、disabledDuring=true、restored=true

前往 Solution →