Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Fix) manage crowdsale to allow edit if it didn't started yet #521

Merged
merged 2 commits into from
Jan 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/manage/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,16 @@ export const processTier = (crowdsaleAddress, crowdsaleNum) => {
})
}

const setCurrentContract = contract => {
const setCurrentContract = (contract, index) => {
const currentDate = new Date().getTime()
if (contract.startDate <= currentDate && currentDate <= contract.endDate) contract.current = true
const { startDate, endDate } = contract
const isActive = startDate <= currentDate && currentDate <= endDate
const isFirstTier = index === 0

if (isActive || (isFirstTier && currentDate < startDate)) {
contract.current = true
}

return contract
}

Expand Down