1- import { entries , makeAutoObservable , runInAction } from 'mobx' ;
1+ import { makeAutoObservable , runInAction } from 'mobx' ;
22import {
33 DurationBucketState ,
44 NodeTier ,
@@ -8,6 +8,7 @@ import Big from 'big.js';
88import debounce from 'lodash/debounce' ;
99import { annualPercentRate , toBasisPoints , toPercent } from 'util/bigmath' ;
1010import { BLOCKS_PER_DAY } from 'util/constants' ;
11+ import { blocksToTime } from 'util/formatters' ;
1112import { prefixTranslation } from 'util/translate' ;
1213import { ONE_UNIT } from 'api/pool' ;
1314import { Store } from 'store' ;
@@ -93,9 +94,9 @@ export default class OrderFormView {
9394 /** the markets currently open or accepting orders */
9495 get marketsAcceptingOrders ( ) {
9596 const { MARKET_OPEN , ACCEPTING_ORDERS } = DurationBucketState ;
96- return entries ( this . _store . batchStore . leaseDurations )
97- . map ( ( [ duration , state ] ) => ( { duration , state } ) )
98- . filter ( ( { state } ) => state === MARKET_OPEN || state === ACCEPTING_ORDERS ) ;
97+ return this . _store . batchStore . sortedDurations . filter (
98+ ( { state } ) => state === MARKET_OPEN || state === ACCEPTING_ORDERS ,
99+ ) ;
99100 }
100101
101102 /** the mapping of market states to user-friendly labels */
@@ -112,7 +113,7 @@ export default class OrderFormView {
112113 get durationOptions ( ) {
113114 const labels = this . marketStateLabels ;
114115 const durations = this . marketsAcceptingOrders . map ( ( { duration, state } ) => ( {
115- label : `${ duration } (${ labels [ state ] } )` ,
116+ label : `${ blocksToTime ( duration ) } (${ labels [ state ] } )` ,
116117 value : `${ duration } ` ,
117118 } ) ) ;
118119
@@ -122,7 +123,9 @@ export default class OrderFormView {
122123 // add a default option with a value of zero to signify that the duration
123124 // currently being displayed should be used
124125 durations . unshift ( {
125- label : `${ l ( 'inView' ) } (${ selectedDuration } , ${ labels [ selectedState ] } )` ,
126+ label : `${ l ( 'inView' ) } (${ blocksToTime ( selectedDuration ) } , ${
127+ labels [ selectedState ]
128+ } )`,
126129 value : '0' ,
127130 } ) ;
128131 }
0 commit comments