Skip to content

Commit

Permalink
Initialize globalMinCap, rate and start and end time with values from…
Browse files Browse the repository at this point in the history
… store
  • Loading branch information
Franco Victorio committed Mar 15, 2018
1 parent 5bac0e3 commit 6cf3208
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/components/stepThree/CrowdsaleBlock.js
Expand Up @@ -18,8 +18,10 @@ export class CrowdsaleBlock extends React.Component {
constructor (props) {
super(props)

const { tierStore, num } = this.props

this.state = {
rate: '',
rate: tierStore.tiers[num].rate || '',
validation: {
rate: {
pristine: true,
Expand All @@ -31,8 +33,11 @@ export class CrowdsaleBlock extends React.Component {

componentWillMount () {
const { tierStore, num } = this.props
const startTime = 0 === num ? defaultCompanyStartDate() : this.tierEndTime(num - 1)
const endTime = 0 === num ? defaultCompanyEndDate(startTime) : defaultCompanyEndDate(this.tierEndTime(num - 1))
const defaultStartTime = 0 === num ? defaultCompanyStartDate() : this.tierEndTime(num - 1)
const defaultEndTime = 0 === num ? defaultCompanyEndDate(defaultStartTime) : defaultCompanyEndDate(this.tierEndTime(num - 1))

const startTime = tierStore.tiers[num].startTime || defaultStartTime
const endTime = tierStore.tiers[num].endTime || defaultEndTime

tierStore.setTierProperty(startTime, 'startTime', num)
tierStore.setTierProperty(endTime, 'endTime', num)
Expand Down
2 changes: 1 addition & 1 deletion src/components/stepThree/index.js
Expand Up @@ -51,7 +51,7 @@ export class stepThree extends React.Component {
this.state = {
loading: true,
gasPriceSelected: gasPriceStore.slow.id,
minCap: '',
minCap: props.tierStore.globalMinCap || '',
validation: {
gasPrice: {
pristine: true,
Expand Down

0 comments on commit 6cf3208

Please sign in to comment.