diff --git a/src/App.tsx b/src/App.tsx index b2af253..28261cc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -152,10 +152,14 @@ export function App() { let name: string if (source.kind === "url") { name = source.name ?? nameFromUrl(source.url) + let lastLabel = "" buf = await fetchWithProgress(source.url, (loaded, total) => { if (stale()) return const size = total ? `${formatBytes(loaded)} / ${formatBytes(total)}` : formatBytes(loaded) - setLoadState({ label: `도면 내려받는 중 (${size})`, value: total ? Math.round(Math.min(1, loaded / total) * 50) : null, busy: true }) + const label = `도면 내려받는 중 (${size})` + if (label === lastLabel) return // one update per visible change, not per network chunk + lastLabel = label + setLoadState({ label, value: total ? Math.round(Math.min(1, loaded / total) * 50) : null, busy: true }) }) } else { name = source.file.name