mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +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 initContinueWatchingPreviewState = () => ({
|
||||
lib_items: []
|
||||
});
|
||||
|
||||
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||
const lib_items = continue_watching_preview.lib_items.map((lib_item) => ({
|
||||
id: lib_item._id,
|
||||
|
|
@ -22,6 +20,10 @@ const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
|||
};
|
||||
|
||||
const useContinueWatchingPreview = () => {
|
||||
const { core } = useServices();
|
||||
const initContinueWatchingPreviewState = React.useMemo(() => {
|
||||
return mapContinueWatchingPreviewState(core.getState('continue_watching_preview'));
|
||||
}, []);
|
||||
return useModelState({
|
||||
model: 'continue_watching_preview',
|
||||
map: mapContinueWatchingPreviewState,
|
||||
|
|
|
|||
Loading…
Reference in a new issue