mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-11 17:28:05 +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>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { StrictMode } from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import { registerSW } from 'virtual:pwa-register'
|
|
// Self-hosted variable fonts: no third-party request, cached offline by the SW.
|
|
// Browsers only download the unicode-range subsets a page actually uses.
|
|
import '@fontsource-variable/inter/wght.css'
|
|
import '@fontsource-variable/lora/wght.css'
|
|
import '@fontsource-variable/lora/wght-italic.css'
|
|
import '@fontsource-variable/playfair-display/wght.css'
|
|
import '@fontsource-variable/playfair-display/wght-italic.css'
|
|
import '@fontsource/atkinson-hyperlegible/latin-400.css'
|
|
import '@fontsource/atkinson-hyperlegible/latin-700.css'
|
|
import './index.css'
|
|
import App from './App.tsx'
|
|
import { useUpdate } from './stores/updateStore'
|
|
|
|
const reload = () => window.location.reload()
|
|
|
|
registerSW({
|
|
immediate: true,
|
|
onNeedRefresh() {
|
|
useUpdate.getState().setAvailable(reload)
|
|
},
|
|
})
|
|
|
|
// The service worker activates new versions right away; when it takes over a
|
|
// page that was already controlled, offer a reload instead of forcing one
|
|
// under the reader.
|
|
if ('serviceWorker' in navigator) {
|
|
const hadController = !!navigator.serviceWorker.controller
|
|
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
|
if (hadController) useUpdate.getState().setAvailable(reload)
|
|
})
|
|
}
|
|
|
|
createRoot(document.getElementById('root')!).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>,
|
|
)
|