Skip to content

Commit

Permalink
Merge pull request #1107 from Keith-CY/fix-withdraw-apc
Browse files Browse the repository at this point in the history
fix(neuron): use deposit timestamp to calculate phase2 dao cell apc
  • Loading branch information
Keith-CY authored Nov 14, 2019
2 parents e8ac6fb + abdab3f commit b5d4b35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DAORecord = ({
actionLabel,
onClick,
timestamp,
depositTimestamp,
depositOutPoint,
epoch,
withdraw,
Expand Down Expand Up @@ -142,7 +143,13 @@ const DAORecord = ({
</div>
</div>
<div className={styles.secondaryInfo}>
<span>{`APC: ~${calculateAPC(compensation.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
<span>
{`APC: ~${calculateAPC(
compensation.toString(),
capacity,
`${Date.now() - +(depositTimestamp || timestamp)}`
)}%`}
</span>
<span>{uniformTimeFormatter(+timestamp)}</span>
<span>{metaInfo}</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/types/App/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ declare namespace State {
typeHash: string | null
daoData: string
timestamp: string
depositTimestamp?: string
}

interface NervosDAO {
Expand Down

0 comments on commit b5d4b35

Please sign in to comment.