Safer popup params to object logic

This commit is contained in:
2022-08-13 00:40:20 +02:00
parent b7ac8bce83
commit 577a64a32f
4 changed files with 10 additions and 12 deletions

View File

@@ -48,17 +48,15 @@
const params = new URLSearchParams(window.location.search);
params.forEach((value, key) => {
if (
!(
key === MediaTypes.Movie ||
key === MediaTypes.Show ||
key === MediaTypes.Person
)
key !== MediaTypes.Movie &&
key !== MediaTypes.Show &&
key !== MediaTypes.Person
) {
return;
}
_id = Number(params.get(key));
_type = MediaTypes[key];
_type = key;
});
return { id: _id, type: _type };

View File

@@ -23,7 +23,7 @@
<img
ref="poster-image"
class="person-item__img is-loaded"
:alt="`Image of ${person.name}`"
alt="Image of person"
:src="poster"
/>
</figure>