diff --git a/apps/playnite-web/src/routes/_index.tsx b/apps/playnite-web/src/routes/_index.tsx index e105b33d5..cbd3adbaf 100644 --- a/apps/playnite-web/src/routes/_index.tsx +++ b/apps/playnite-web/src/routes/_index.tsx @@ -15,12 +15,17 @@ import { Playlist } from '../domain/types' async function loader({ request }: LoaderFunctionArgs) { const api = getGameApi() - - const playing = await api.getPlaylistByName('On Deck') - - return json({ - playing, - }) + try { + const playing = await api.getPlaylistByName('On Deck') + return json({ + playing, + }) + } catch (e) { + console.error(e) + return json({ + playing: {}, + }) + } } const noFilter = new NoFilter() diff --git a/apps/playnite-web/src/routes/browse.tsx b/apps/playnite-web/src/routes/browse.tsx index fd785ae2d..390b13026 100644 --- a/apps/playnite-web/src/routes/browse.tsx +++ b/apps/playnite-web/src/routes/browse.tsx @@ -47,13 +47,15 @@ function Browse() { const { gamesOnPlatforms, filterValues } = (useLoaderData() || {}) as unknown as { gamesOnPlatforms?: GameOnPlatform[] - filterValues: { - feature: { id: string; name: string }[] - } + filterValues: + | { + feature: { id: string; name: string }[] + } + | undefined } const dispatch = useDispatch() - Object.entries(filterValues).forEach(([key, value]) => { + Object.entries(filterValues ?? {}).forEach(([key, value]) => { dispatch(setFilterTypeValues({ filterTypeName: key, values: value })) })