Download apps/readest-app/src/utils/error.ts from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 475 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/error.ts
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/utils/error.ts
-
curl -L -o error.ts https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/error.ts
475 Bytes
| export const handleGlobalError = (e: Error) => { | |
| const isChunkError = e?.message?.includes('Loading chunk'); | |
| if (!isChunkError) { | |
| const now = Date.now(); | |
| const lastReload = Number(sessionStorage.getItem('lastErrorReload') || '0'); | |
| if (now - lastReload > 60_000) { | |
| sessionStorage.setItem('lastErrorReload', String(now)); | |
| window.location.reload(); | |
| } else { | |
| console.warn('Error detected, but reload suppressed (rate limit)'); | |
| } | |
| } | |
| }; | |