mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
ContinueWatchingPreview used in Board
This commit is contained in:
parent
b3c826a16e
commit
469aeda23b
2 changed files with 10 additions and 10 deletions
|
|
@ -2,7 +2,7 @@ const React = require('react');
|
|||
const { useServices } = require('stremio/services');
|
||||
const { MainNavBars, MetaRow, useDeepEqualMemo } = require('stremio/common');
|
||||
const useBoard = require('./useBoard');
|
||||
const useContinueWatching = require('./useContinueWatching');
|
||||
const useContinueWatchingPreview = require('./useContinueWatchingPreview');
|
||||
const styles = require('./styles');
|
||||
|
||||
const CONTINUE_WATCHING_OPTIONS = [
|
||||
|
|
@ -14,7 +14,7 @@ const CONTINUE_WATCHING_OPTIONS = [
|
|||
const Board = () => {
|
||||
const { core } = useServices();
|
||||
const board = useBoard();
|
||||
const continueWatching = useContinueWatching();
|
||||
const continueWatching = useContinueWatchingPreview();
|
||||
const continueWatchingItems = useDeepEqualMemo(() => {
|
||||
const onSelect = (event) => {
|
||||
switch (event.value) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
const { useModelState } = require('stremio/common');
|
||||
|
||||
const initContinueWatchingState = () => ({
|
||||
const initContinueWatchingPreviewState = () => ({
|
||||
lib_items: []
|
||||
});
|
||||
|
||||
const mapContinueWatchingState = (continue_watching) => {
|
||||
const lib_items = continue_watching.lib_items.map((lib_item) => ({
|
||||
const mapContinueWatchingPreviewState = (continue_watching_preview) => {
|
||||
const lib_items = continue_watching_preview.lib_items.map((lib_item) => ({
|
||||
id: lib_item._id,
|
||||
type: lib_item.type,
|
||||
name: lib_item.name,
|
||||
|
|
@ -21,12 +21,12 @@ const mapContinueWatchingState = (continue_watching) => {
|
|||
return { lib_items };
|
||||
};
|
||||
|
||||
const useContinueWatching = () => {
|
||||
const useContinueWatchingPreview = () => {
|
||||
return useModelState({
|
||||
model: 'continue_watching',
|
||||
map: mapContinueWatchingState,
|
||||
init: initContinueWatchingState
|
||||
model: 'continue_watching_preview',
|
||||
map: mapContinueWatchingPreviewState,
|
||||
init: initContinueWatchingPreviewState
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = useContinueWatching;
|
||||
module.exports = useContinueWatchingPreview;
|
||||
Loading…
Reference in a new issue