Skip to content

Commit

Permalink
fix: validator img if moniker is empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpeach committed Jul 2, 2024
1 parent 2e694da commit 78fe1e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/ValidatorBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ValidatorBadge = ({
{isMobile && hasLabel && <MobileLabel label="Validator" />}
<ExplorerLink
type="validator_address"
value={validator.moniker ?? validator.validatorAddress}
value={validator.moniker || validator.validatorAddress}
copyValue={validator.validatorAddress}
externalLink={
isValidatorExternalLink
Expand Down
8 changes: 6 additions & 2 deletions src/lib/components/ValidatorImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const ValidatorImage = ({
}: ValidatorImageProps) => {
const { data, isLoading } = useValidatorImage(validator);

if (!validator) {
if (
!validator ||
!validator.moniker ||
validator.moniker.trim().length === 0
) {
return (
<Image
boxSize={boxSize}
Expand All @@ -27,7 +31,7 @@ export const ValidatorImage = ({
);
}

return isLoading || !data || !validator.moniker ? (
return isLoading || !data ? (
<SkeletonCircle boxSize={boxSize} minWidth={boxSize} />
) : (
<Image
Expand Down

0 comments on commit 78fe1e5

Please sign in to comment.