Adjust account actions slash indicator (#3394)

This commit is contained in:
Jaco Greeff 2020-08-11 23:35:26 +02:00 committed by GitHub
parent e6818ea160
commit 612dbd55b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -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}}', {

View File

@ -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[];
}