Skip to content

Commit abdab3f

Browse files
committed
fix(neuron): use deposit timestamp to calculate phase2 dao cell apc
1 parent 98ba68d commit abdab3f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const DAORecord = ({
1919
actionLabel,
2020
onClick,
2121
timestamp,
22+
depositTimestamp,
2223
depositOutPoint,
2324
epoch,
2425
withdraw,
@@ -142,7 +143,13 @@ const DAORecord = ({
142143
</div>
143144
</div>
144145
<div className={styles.secondaryInfo}>
145-
<span>{`APC: ~${calculateAPC(compensation.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
146+
<span>
147+
{`APC: ~${calculateAPC(
148+
compensation.toString(),
149+
capacity,
150+
`${Date.now() - +(depositTimestamp || timestamp)}`
151+
)}%`}
152+
</span>
146153
<span>{uniformTimeFormatter(+timestamp)}</span>
147154
<span>{metaInfo}</span>
148155
</div>

packages/neuron-ui/src/types/App/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ declare namespace State {
177177
typeHash: string | null
178178
daoData: string
179179
timestamp: string
180+
depositTimestamp?: string
180181
}
181182

182183
interface NervosDAO {

0 commit comments

Comments
 (0)