Skip to content

Commit

Permalink
Fallback to stake group address
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed Feb 22, 2024
1 parent 696182d commit 133624a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/features/staking/StakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ function GroupField({
}, [defaultGroup, helpers]);

const currentGroup = addressToGroup?.[field.value];
const groupName = currentGroup?.name
? cleanGroupName(currentGroup.name)
: field.value
? field.value
: 'Select group';

const sortedGroups = useMemo(() => {
if (!addressToGroup) return [];
Expand Down Expand Up @@ -237,9 +242,7 @@ function GroupField({
<div className="flex w-full items-center justify-between">
<div className="flex items-center space-x-2">
<ValidatorGroupLogo address={field.value} size={28} />
<span className="text-black">
{currentGroup?.name ? cleanGroupName(currentGroup.name) : 'Select group'}
</span>
<span className="text-black">{groupName}</span>
</div>
<ChevronIcon direction="s" width={14} height={14} />
</div>
Expand Down

0 comments on commit 133624a

Please sign in to comment.