@@ -20,14 +20,17 @@ const TimeLine: FC<TimeLineProps> = ({ organization }) => {
20
20
21
21
const { game } = useGame ( numId )
22
22
23
- const { startTime, endTime, progress } = getGameStatus ( game )
23
+ const { startTime, endTime, progress, finished } = getGameStatus ( game )
24
24
25
25
const totDuration = endTime . diff ( startTime , 'd' )
26
26
const longGame = totDuration > 14
27
+
27
28
const weekProgress = ( 7 / totDuration ) * 100
29
+ const weekStart = progress - weekProgress
30
+ const weekEnd = progress
28
31
29
- const scaleStart = progress - weekProgress
30
- const scaleEnd = progress
32
+ const drawStart = longGame && ! finished ? weekStart : 0
33
+ const drawEnd = longGame && ! finished ? weekEnd : 100
31
34
32
35
const [ now , setNow ] = useState < Date > ( new Date ( ) )
33
36
const [ chartData , setChartData ] = useState < any > ( )
@@ -151,14 +154,14 @@ const TimeLine: FC<TimeLineProps> = ({ organization }) => {
151
154
dataZoom : [
152
155
{
153
156
type : 'inside' ,
154
- start : longGame ? scaleStart : 0 ,
155
- end : longGame ? scaleEnd : 100 ,
157
+ start : drawStart ,
158
+ end : drawEnd ,
156
159
xAxisIndex : 0 ,
157
160
filterMode : 'none' ,
158
161
} ,
159
162
{
160
- start : longGame ? scaleStart : 0 ,
161
- end : longGame ? scaleEnd : 100 ,
163
+ start : drawStart ,
164
+ end : drawEnd ,
162
165
xAxisIndex : 0 ,
163
166
showDetail : false ,
164
167
} ,
0 commit comments