mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-22 04:22:02 +00:00
add validation to the MetaDetails load action
This commit is contained in:
parent
0d0717b862
commit
93c11fd7be
1 changed files with 25 additions and 19 deletions
|
|
@ -32,6 +32,7 @@ const mapMetaDetailsState = (meta_details) => {
|
|||
|
||||
const useMetaDetails = (urlParams) => {
|
||||
const loadMetaDetailsAction = React.useMemo(() => {
|
||||
if (typeof urlParams.type === 'string' && typeof urlParams.id === 'string') {
|
||||
return {
|
||||
action: 'Load',
|
||||
args: {
|
||||
|
|
@ -55,6 +56,11 @@ const useMetaDetails = (urlParams) => {
|
|||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
action: 'Unload'
|
||||
};
|
||||
}
|
||||
}, [urlParams]);
|
||||
return useModelState({
|
||||
model: 'meta_details',
|
||||
|
|
|
|||
Loading…
Reference in a new issue