mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
useAddons exports only used props
This commit is contained in:
parent
c19723bb05
commit
7dfb92bb06
1 changed files with 7 additions and 7 deletions
|
|
@ -5,22 +5,22 @@ const { useModelState } = require('stremio/common');
|
|||
const initAddonsState = () => ({
|
||||
selectable: {
|
||||
types: [],
|
||||
catalogs: [],
|
||||
extra: [],
|
||||
has_next_page: false,
|
||||
has_prev_page: false
|
||||
catalogs: []
|
||||
},
|
||||
catalog_resource: null
|
||||
});
|
||||
|
||||
const mapAddonsStateWithCtx = (addons, ctx) => {
|
||||
const selectable = addons.selectable;
|
||||
const selectable = {
|
||||
types: addons.selectable.types,
|
||||
catalogs: addons.selectable.catalogs
|
||||
};
|
||||
// TODO replace catalog content if resource catalog id is MY
|
||||
const catalog_resource = addons.catalog_resource !== null && addons.catalog_resource.content.type === 'Ready' ?
|
||||
{
|
||||
...addons.catalog_resource,
|
||||
request: addons.catalog_resource.request,
|
||||
content: {
|
||||
...addons.catalog_resource.content,
|
||||
type: addons.catalog_resource.content.type,
|
||||
content: addons.catalog_resource.content.content.map((addon) => ({
|
||||
transportUrl: addon.transportUrl,
|
||||
installed: ctx.profile.addons.some(({ transportUrl }) => transportUrl === addon.transportUrl),
|
||||
|
|
|
|||
Loading…
Reference in a new issue