mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use optional chaining in home component
This commit is contained in:
parent
189ffaf13e
commit
1b8474b4a3
1 changed files with 3 additions and 3 deletions
|
@ -111,7 +111,7 @@ const Home: FunctionComponent = () => {
|
||||||
const previousIndex = e.detail.previousIndex;
|
const previousIndex = e.detail.previousIndex;
|
||||||
|
|
||||||
const previousTabController = previousIndex == null ? null : tabControllers[previousIndex];
|
const previousTabController = previousIndex == null ? null : tabControllers[previousIndex];
|
||||||
if (previousTabController && previousTabController.onPause) {
|
if (previousTabController?.onPause) {
|
||||||
previousTabController.onPause();
|
previousTabController.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ const Home: FunctionComponent = () => {
|
||||||
|
|
||||||
if (!currentTabController) {
|
if (!currentTabController) {
|
||||||
mainTabsManager.selectedTabIndex(initialTabIndex);
|
mainTabsManager.selectedTabIndex(initialTabIndex);
|
||||||
} else if (currentTabController && currentTabController.onResume) {
|
} else if (currentTabController?.onResume) {
|
||||||
currentTabController.onResume({});
|
currentTabController.onResume({});
|
||||||
}
|
}
|
||||||
(document.querySelector('.skinHeader') as HTMLDivElement).classList.add('noHomeButtonHeader');
|
(document.querySelector('.skinHeader') as HTMLDivElement).classList.add('noHomeButtonHeader');
|
||||||
|
@ -134,7 +134,7 @@ const Home: FunctionComponent = () => {
|
||||||
|
|
||||||
const onPause = useCallback(() => {
|
const onPause = useCallback(() => {
|
||||||
const currentTabController = tabController.current;
|
const currentTabController = tabController.current;
|
||||||
if (currentTabController && currentTabController.onPause) {
|
if (currentTabController?.onPause) {
|
||||||
currentTabController.onPause();
|
currentTabController.onPause();
|
||||||
}
|
}
|
||||||
(document.querySelector('.skinHeader') as HTMLDivElement).classList.remove('noHomeButtonHeader');
|
(document.querySelector('.skinHeader') as HTMLDivElement).classList.remove('noHomeButtonHeader');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue