mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-20 21:58:11 +02:00
- Service worker activates new versions immediately (skipWaiting + clientsClaim). In prompt mode a waiting worker kept serving the previous build to tabs that never send SKIP_WAITING, so the old UI hit the new API and showed "Aucun contenu disponible" on every article. Pages already controlled get a reload toast; lazy chunks missing after a deploy reload once. - Reader opens as a large card above the dimmed grid: close with ✕, Escape or a click beside it; previous/next arrows on the sides (desktop) and a bottom bar with the next title (all sizes). - Remove search, the focus banner and decorative headers; plain sentence- case labels instead of tracked capitals; quieter dashboard header. - Fix horizontal overflow of cards and reader navigation on phones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
858 B
TypeScript
24 lines
858 B
TypeScript
import { lazy, type ComponentType } from 'react';
|
|
|
|
/**
|
|
* React.lazy for a named export. After a deploy, chunks of the previous build
|
|
* no longer exist on the server: reload once to pick up the new version
|
|
* instead of showing a blank screen.
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
export function lazyNamed<T extends ComponentType<any>>(load: () => Promise<Record<string, unknown>>, name: string) {
|
|
return lazy(async () => {
|
|
try {
|
|
const mod = await load();
|
|
sessionStorage.removeItem('chunk-reload');
|
|
return { default: mod[name] as T };
|
|
} catch (err) {
|
|
if (!sessionStorage.getItem('chunk-reload')) {
|
|
sessionStorage.setItem('chunk-reload', '1');
|
|
window.location.reload();
|
|
}
|
|
throw err;
|
|
}
|
|
});
|
|
}
|