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