mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 05:36:17 -08:00
fix(pwa): stay in server mode when a known server does not answer
A failed start-up probe used to fall back to browser mode, which showed an empty library while the backend restarted and let new playlists land in the browser. The browser now remembers the server; without an answer it starts in server mode, offline, and reloads once the server is back. Settings → Server shows the backend address instead of the page's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8714b3b445
commit
3bfd5394ef
13 files changed
+357
-69
No files matched your search
@@ -170,7 +170,13 @@ expose desktop-only actions in the PWA/shared UI.
|
||||
deployment wrote a runtime `BACKEND_URL` into `window.__IPTVNATOR_CONFIG__`
|
||||
(the Docker entrypoint does; hosted builds and Electron never probe). On
|
||||
`storage: 'server'` it imports `apps/web/src/app/server-storage/` lazily and
|
||||
merges `provideServerStorage()` into the app config. Everything else of the
|
||||
merges `provideServerStorage()` into the app config, and remembers the
|
||||
instance under `iptvnator-server:instance`. When the probe gets no answer
|
||||
(network error, timeout, or a 5xx such as nginx's 502 while the backend
|
||||
restarts), a browser that remembers this backend still starts in server
|
||||
mode, offline, and reloads once the server answers; it never falls back to
|
||||
an empty browser library. An answer without server storage, or a 404 from
|
||||
an older backend, forgets it (`server-storage-start.ts`). Everything else of the
|
||||
client lives behind the `@iptvnator/services/server-storage` sub-entry, so
|
||||
other builds never load it; `ServerStorageStatusService` and the token
|
||||
helpers stay in the main `@iptvnator/services` barrel because the rail,
|
||||
|
||||
Reference in new issue
Block a user