Fix review feedback

This commit is contained in:
Bill Thornton 2024-05-01 01:39:17 -04:00
parent 23c15f8259
commit 96eff86e3b
2 changed files with 5 additions and 6 deletions

View File

@ -33,9 +33,8 @@ async function mirrorIfEnabled(serverId: string, itemId: string) {
}
document.addEventListener('viewshow', e => {
if (e.detail?.params?.id && e.detail?.params?.serverId) {
const { serverId, id } = e.detail.params;
const { serverId, id } = e.detail?.params || {};
if (serverId && id) {
void mirrorIfEnabled(serverId, id);
}
});

View File

@ -91,7 +91,7 @@ async function loadThemeMedia(serverId, itemId) {
return;
}
if (excludeTypes.indexOf(item.Type) !== -1) {
if (excludeTypes.includes(item.Type)) {
stopIfPlaying();
return;
}
@ -110,8 +110,8 @@ async function loadThemeMedia(serverId, itemId) {
}
document.addEventListener('viewshow', e => {
if (e.detail?.params?.id && e.detail?.params?.serverId) {
const { serverId, id } = e.detail.params;
const { serverId, id } = e.detail?.params || {};
if (serverId && id) {
void loadThemeMedia(serverId, id);
return;
}