Merge pull request #4646 from dmitrylyzo/fix-movies-favorites-crash

Fix Movies/Favorites crash when accessing the missing Shuffle button
This commit is contained in:
Bill Thornton 2023-05-25 11:18:08 -04:00 committed by GitHub
commit a78fea2026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,7 @@ export default function (view, params, tabContent, options) {
elem.addEventListener('click', onPreviousPageClick);
}
tabContent.querySelector('.btnShuffle').classList.toggle('hide', result.TotalRecordCount < 1);
tabContent.querySelector('.btnShuffle')?.classList.toggle('hide', result.TotalRecordCount < 1);
isLoading = false;
loading.hide();
@ -258,7 +258,7 @@ export default function (view, params, tabContent, options) {
itemsContainer.refreshItems();
});
tabElement.querySelector('.btnShuffle').addEventListener('click', shuffle);
tabElement.querySelector('.btnShuffle')?.addEventListener('click', shuffle);
};
let itemsContainer = tabContent.querySelector('.itemsContainer');