mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-18 08:42:48 +00:00
code refactor in DeepLinkHandler
This commit is contained in:
parent
5fb1022336
commit
3c28f671c5
1 changed files with 7 additions and 4 deletions
|
|
@ -4,10 +4,13 @@ const { withCoreSuspender, useStreamingServer } = require('stremio/common');
|
|||
const DeepLinkHandler = () => {
|
||||
const streamingServer = useStreamingServer();
|
||||
React.useEffect(() => {
|
||||
if (streamingServer.torrent && streamingServer.torrent[1].type === 'Ready') {
|
||||
const [_, deepLinks] = streamingServer.torrent[1].content;
|
||||
if (typeof deepLinks.metaDetailsVideos === 'string') {
|
||||
window.location = deepLinks.metaDetailsVideos;
|
||||
if (streamingServer.torrent !== null) {
|
||||
const [, { type, content }] = streamingServer.torrent;
|
||||
if (type === 'Ready') {
|
||||
const [, deepLinks] = content;
|
||||
if (typeof deepLinks.metaDetailsVideos === 'string') {
|
||||
window.location = deepLinks.metaDetailsVideos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [streamingServer.torrent]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue