Show a fallback face for valid face options
Sometimes we just don't have the image! Don't let that stop people from clicking it tho!
This commit is contained in:
parent
a293dc56b5
commit
6a4be0390a
1 changed files with 7 additions and 2 deletions
|
@ -841,12 +841,17 @@ function SpeciesFacesPicker({
|
||||||
const providedSpeciesFace = speciesFacesFromData.find(
|
const providedSpeciesFace = speciesFacesFromData.find(
|
||||||
(f) => f.species.id === defaultSpeciesFace.speciesId
|
(f) => f.species.id === defaultSpeciesFace.speciesId
|
||||||
);
|
);
|
||||||
if (providedSpeciesFace && providedSpeciesFace.neopetsImageHash) {
|
if (providedSpeciesFace) {
|
||||||
return {
|
return {
|
||||||
...defaultSpeciesFace,
|
...defaultSpeciesFace,
|
||||||
colorId: selectedColorId,
|
colorId: selectedColorId,
|
||||||
bodyId: providedSpeciesFace.body.id,
|
bodyId: providedSpeciesFace.body.id,
|
||||||
neopetsImageHash: providedSpeciesFace.neopetsImageHash,
|
// If this species/color pair exists, but without an image hash, then
|
||||||
|
// we want to provide a face so that it's enabled, but use the fallback
|
||||||
|
// image even though it's wrong, so that it looks like _something_.
|
||||||
|
neopetsImageHash:
|
||||||
|
providedSpeciesFace.neopetsImageHash ||
|
||||||
|
defaultSpeciesFace.neopetsImageHash,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return defaultSpeciesFace;
|
return defaultSpeciesFace;
|
||||||
|
|
Loading…
Reference in a new issue