fix: handle stream link

This commit is contained in:
Hryvenko Ihor committed 2026-05-01 22:32:33 +03:00
1 parent c34f8fd3d0
commit 067c4a65ef
2 files changed
+3 -3

No files matched your search

@@ -6,7 +6,6 @@ import { Button } from '@/components/ui/button';
import { Modal } from '@/components/ui/dialog'; import { Modal } from '@/components/ui/dialog';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
import { useM3UUrl, useSetM3UUrl } from '@/hooks/useM3UStreamUrl'; import { useM3UUrl, useSetM3UUrl } from '@/hooks/useM3UStreamUrl';
import { useSession } from '@/hooks/useSession';
import { useSetStreamUrl, useStreamUrl } from '@/hooks/useStreamUrl'; import { useSetStreamUrl, useStreamUrl } from '@/hooks/useStreamUrl';
import { usePrefix, useSetPrefix } from '../../hooks/useMagnetHosts'; import { usePrefix, useSetPrefix } from '../../hooks/useMagnetHosts';
@@ -18,7 +17,7 @@ const showHostManagerModal = create<InstanceProps<string>>(({ onResolve, onRejec
const submitStreamUrl = useSetStreamUrl(); const submitStreamUrl = useSetStreamUrl();
const [M3UUrl, setM3UUrl] = useState(useM3UUrl()); const [M3UUrl, setM3UUrl] = useState(useM3UUrl());
const submitM3UUrl = useSetM3UUrl(); const submitM3UUrl = useSetM3UUrl();
const [session, setSession] = useState(useSession); const [session, setSession] = useState(() => localStorage.getItem('session') ?? '');
return ( return (
<Modal className='m-auto p-2' onClose={onReject}> <Modal className='m-auto p-2' onClose={onReject}>
@@ -70,7 +70,8 @@ const Actions: FC<Props> = ({ torrent, title, provider, show }) => {
if (isSafari) { if (isSafari) {
return fetch(`${M3UUrl}?${params}`, { return fetch(`${M3UUrl}?${params}`, {
method: 'GET', method: 'GET',
keepalive: true keepalive: true,
mode: 'no-cors'
}) })
.catch(() => {}) .catch(() => {})
.finally(() => setIsStreamPending(false)); .finally(() => setIsStreamPending(false));