mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
init CW Preview fixed
This commit is contained in:
parent
469aeda23b
commit
f0e51c5055
1 changed files with 6 additions and 4 deletions
|
|
@ -1,9 +1,7 @@
|
||||||
|
const React = require('react');
|
||||||
|
const { useServices } = require('stremio/services');
|
||||||
const { useModelState } = require('stremio/common');
|
const { useModelState } = require('stremio/common');
|
||||||
|
|
||||||
const initContinueWatchingPreviewState = () => ({
|
|
||||||
lib_items: []
|
|
||||||
});
|
|
||||||
|
|
||||||
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||||
const lib_items = continue_watching_preview.lib_items.map((lib_item) => ({
|
const lib_items = continue_watching_preview.lib_items.map((lib_item) => ({
|
||||||
id: lib_item._id,
|
id: lib_item._id,
|
||||||
|
|
@ -22,6 +20,10 @@ const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const useContinueWatchingPreview = () => {
|
const useContinueWatchingPreview = () => {
|
||||||
|
const { core } = useServices();
|
||||||
|
const initContinueWatchingPreviewState = React.useMemo(() => {
|
||||||
|
return mapContinueWatchingPreviewState(core.getState('continue_watching_preview'));
|
||||||
|
}, []);
|
||||||
return useModelState({
|
return useModelState({
|
||||||
model: 'continue_watching_preview',
|
model: 'continue_watching_preview',
|
||||||
map: mapContinueWatchingPreviewState,
|
map: mapContinueWatchingPreviewState,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue