Fix council off-by-1 (#1770)

* Fix council off-by-1

* Nor args for normal elections module
This commit is contained in:
Jaco Greeff 2019-10-27 12:53:35 +01:00 committed by GitHub
parent ba988b29aa
commit 349c427c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -5,7 +5,6 @@
import { ApiProps } from '@polkadot/react-api/types';
import { ComponentProps } from './types';
import BN from 'bn.js';
import React from 'react';
import { withApi } from '@polkadot/react-api';
import { Button } from '@polkadot/react-components';
@ -27,13 +26,7 @@ class SubmitCandidacy extends TxModal<Props, State> {
? 'electionsPhragmen.submitCandidacy'
: 'elections.submitCandidacy';
protected txParams = (): [BN] | [] => {
const { api, electionsInfo: { candidateCount } } = this.props;
return api.tx.electionsPhragmen
? []
: [candidateCount];
}
protected txParams = (): [] => [];
protected isDisabled = (): boolean => {
const { accountId } = this.state;

View File

@ -19,7 +19,7 @@ function Summary ({ electionsInfo: { members, candidateCount, desiredSeats, term
<SummaryBox>
<section>
<CardSummary label={t('seats')}>
{formatNumber(Object.keys(members).length)}/{formatNumber(desiredSeats)}
{formatNumber(members.length)}/{formatNumber(desiredSeats)}
</CardSummary>
<CardSummary label={t('candidates')}>
{formatNumber(candidateCount)}