mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add livetv view
This commit is contained in:
parent
c37783479e
commit
e41436552e
44 changed files with 1396 additions and 749 deletions
|
@ -3,17 +3,22 @@ import { useLocation, useSearchParams } from 'react-router-dom';
|
|||
|
||||
const useCurrentTab = () => {
|
||||
const location = useLocation();
|
||||
const [searchParams] = useSearchParams();
|
||||
const searchParamsParentId = searchParams.get('topParentId');
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const searchParamsTab = searchParams.get('tab');
|
||||
const currentTabIndex: number =
|
||||
searchParamsTab !== null ?
|
||||
parseInt(searchParamsTab, 10) :
|
||||
getDefaultTabIndex(location.pathname, searchParamsParentId);
|
||||
const libraryId =
|
||||
location.pathname === '/livetv.html' ?
|
||||
'livetv' :
|
||||
searchParams.get('topParentId');
|
||||
const activeTab: number =
|
||||
searchParamsTab !== null ?
|
||||
parseInt(searchParamsTab, 10) :
|
||||
getDefaultTabIndex(location.pathname, libraryId);
|
||||
|
||||
return {
|
||||
searchParamsParentId,
|
||||
currentTabIndex
|
||||
searchParams,
|
||||
setSearchParams,
|
||||
libraryId,
|
||||
activeTab
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue