mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
feat: change metaDetails action
This commit is contained in:
parent
67f4f349bb
commit
9ccc6b8271
3 changed files with 18 additions and 7 deletions
|
|
@ -277,6 +277,10 @@
|
|||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
padding: 0 1rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,6 +79,16 @@ const Discover = ({ urlParams, queryParams }) => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!selectedMetaItem.inLibrary) {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'AddToLibrary',
|
||||
args: selectedMetaItem
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
|
|
|
|||
|
|
@ -65,18 +65,15 @@ const MetaDetails = ({ urlParams, queryParams }) => {
|
|||
});
|
||||
}, [metaDetails]);
|
||||
const toggleWatched = React.useCallback(() => {
|
||||
if (metaDetails.metaItem.content.content === null || metaDetails.metaItem.content.type !== 'Ready') {
|
||||
if (metaDetails.metaItem === null || metaDetails.metaItem.content.type !== 'Ready') {
|
||||
return;
|
||||
}
|
||||
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
action: 'MetaDetails',
|
||||
args: {
|
||||
action: 'LibraryItemMarkAsWatched',
|
||||
args: {
|
||||
id: metaDetails.metaItem.content.content.id,
|
||||
is_watched: !metaDetails.metaItem.content.content.watched
|
||||
}
|
||||
action: 'MarkAsWatched',
|
||||
args: !metaDetails.metaItem.watched
|
||||
}
|
||||
});
|
||||
}, [metaDetails]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue