mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
refactor: rendering of mark as watched option
This commit is contained in:
parent
23dfeb263b
commit
4d80eb3b3c
1 changed files with 17 additions and 17 deletions
|
|
@ -32,7 +32,7 @@ const LibItem = ({ _id, removable, notifications, watched, ...props }) => {
|
|||
case 'details':
|
||||
return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string');
|
||||
case 'watched':
|
||||
return typeof _id === 'string' && watched !== null;
|
||||
return props.deepLinks && (typeof props.deepLinks.metaDetailsVideos === 'string' || typeof props.deepLinks.metaDetailsStreams === 'string');
|
||||
case 'dismiss':
|
||||
return typeof _id === 'string' && props.progress !== null && !isNaN(props.progress);
|
||||
case 'remove':
|
||||
|
|
@ -70,6 +70,22 @@ const LibItem = ({ _id, removable, notifications, watched, ...props }) => {
|
|||
|
||||
break;
|
||||
}
|
||||
case 'watched': {
|
||||
if (typeof _id === 'string') {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'LibraryItemMarkAsWatched',
|
||||
args: {
|
||||
id: _id,
|
||||
is_watched: !watched
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 'dismiss': {
|
||||
if (typeof _id === 'string') {
|
||||
core.transport.dispatch({
|
||||
|
|
@ -90,22 +106,6 @@ const LibItem = ({ _id, removable, notifications, watched, ...props }) => {
|
|||
|
||||
break;
|
||||
}
|
||||
case 'watched': {
|
||||
if (typeof _id === 'string') {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'LibraryItemMarkAsWatched',
|
||||
args: {
|
||||
id: _id,
|
||||
is_watched: !watched
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 'remove': {
|
||||
if (typeof _id === 'string') {
|
||||
core.transport.dispatch({
|
||||
|
|
|
|||
Loading…
Reference in a new issue