Merge pull request #948 from Stremio/fix/discover-catalog-select

Discover: fix invalid catalog crash
This commit is contained in:
Tim 2025-06-25 14:12:56 +02:00 committed by GitHub
commit 125a2650f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,6 @@ const mapSelectableInputs = (discover, t) => {
window.location = value; window.location = value;
} }
}; };
const selectedCatalog = discover.selectable.catalogs.find(({ selected }) => selected);
const catalogSelect = { const catalogSelect = {
options: discover.selectable.catalogs options: discover.selectable.catalogs
.map(({ id, name, addon, deepLinks }) => ({ .map(({ id, name, addon, deepLinks }) => ({
@ -29,9 +28,9 @@ const mapSelectableInputs = (discover, t) => {
label: t.catalogTitle({ addon, id, name }), label: t.catalogTitle({ addon, id, name }),
title: `${name} (${addon.manifest.name})` title: `${name} (${addon.manifest.name})`
})), })),
value: discover.selected?.request.path.id value: discover.selectable.catalogs
? selectedCatalog.deepLinks.discover .filter(({ selected }) => selected)
: undefined, .map(({ deepLinks }) => deepLinks.discover),
title: discover.selected !== null title: discover.selected !== null
? () => { ? () => {
const selectableCatalog = discover.selectable.catalogs const selectableCatalog = discover.selectable.catalogs