mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 13:52:12 +00:00
fix selectable catalogs
This commit is contained in:
parent
c69c3fe1f4
commit
c76e723523
1 changed files with 10 additions and 3 deletions
|
|
@ -49,17 +49,24 @@ const mapSelectableInputs = (discover) => {
|
|||
isRequired: isRequired,
|
||||
options: options.map(({ value, deepLinks }) => ({
|
||||
label: typeof value === 'string' ? value : 'None',
|
||||
value: deepLinks.discover
|
||||
value: JSON.stringify({
|
||||
href: deepLinks.discover,
|
||||
value
|
||||
})
|
||||
})),
|
||||
selected: options
|
||||
.filter(({ selected }) => selected)
|
||||
.map(({ deepLinks }) => deepLinks.discover),
|
||||
.map(({ value, deepLinks }) => JSON.stringify({
|
||||
href: deepLinks.discover,
|
||||
value
|
||||
})),
|
||||
renderLabelText: options.some(({ selected, value }) => selected && value === null) ?
|
||||
() => `Select ${name}`
|
||||
:
|
||||
null,
|
||||
onSelect: (event) => {
|
||||
window.location = event.value;
|
||||
const { href } = JSON.parse(event.value);
|
||||
window.location = href;
|
||||
}
|
||||
}));
|
||||
const paginationInput = discover.selectable.prevPage || discover.selectable.nextPage ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue