mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 03:49:07 +00:00
Safer popup params to object logic
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user