Adjust account actions slash indicator (#3394)
This commit is contained in:
parent
e6818ea160
commit
612dbd55b4
@ -75,12 +75,11 @@ function Account ({ allSlashes, className = '', info: { controllerId, destinatio
|
||||
const slashes = all
|
||||
.filter(({ others, validator }) => validator.eq(stashId) || others.some(([nominatorId]) => nominatorId.eq(stashId)))
|
||||
.map(({ others, own, payout, reporters, validator }) => ({
|
||||
isValidator: validator.eq(stashId), others, own, payout, reporters, validator
|
||||
others, own, payout, reporters, validator
|
||||
}));
|
||||
|
||||
return {
|
||||
era,
|
||||
isValidator: slashes.some(({ isValidator }) => isValidator),
|
||||
slashes
|
||||
};
|
||||
})
|
||||
@ -105,7 +104,7 @@ function Account ({ allSlashes, className = '', info: { controllerId, destinatio
|
||||
return (
|
||||
<tr className={className}>
|
||||
<td className='badge together'>
|
||||
{!isStashNominating && slashes.length !== 0 && (
|
||||
{slashes.length !== 0 && (
|
||||
<Badge
|
||||
color='red'
|
||||
hover={t<string>('Slashed in era {{eras}}', {
|
||||
|
||||
@ -12,7 +12,6 @@ export interface AmountValidateState {
|
||||
}
|
||||
|
||||
interface Unapplied {
|
||||
isValidator: boolean;
|
||||
others: UnappliedSlashOther[];
|
||||
own: Balance;
|
||||
payout: Balance;
|
||||
@ -22,6 +21,5 @@ interface Unapplied {
|
||||
|
||||
export interface Slash {
|
||||
era: BN;
|
||||
isValidator: boolean;
|
||||
slashes: Unapplied[];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user