File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/components/NetworkStats Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const NetworkStats: FC<NetworkStatsProps> = ({
3030 } = syncData
3131
3232 const { rate, status } = valInclusionData
33- const headSlotStatus = formatAtHeadSlotStatus ( - syncDistance )
33+ const headSlotStatus = formatAtHeadSlotStatus ( syncDistance )
3434
3535 const participationClasses = addClassString ( 'border-none' , [ ! rate && 'opacity-20' ] )
3636
@@ -57,7 +57,7 @@ const NetworkStats: FC<NetworkStatsProps> = ({
5757 title = { t ( 'networkStats.blockBehind' ) }
5858 status = { headSlotStatus }
5959 metricFontSize = 'text-subtitle3'
60- metric = { String ( - syncDistance ) }
60+ metric = { String ( syncDistance ) }
6161 />
6262 < NetworkPeerSpeedometer peerData = { peerData } />
6363 < NetworkStatBlock
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import { StatusColor } from '../../src/types'
44describe ( 'formatAtHeadSlotStatus' , ( ) => {
55 it ( 'should return correct status' , ( ) => {
66 expect ( formatAtHeadSlotStatus ( 0 ) ) . toBe ( StatusColor . SUCCESS )
7- expect ( formatAtHeadSlotStatus ( - 1 ) ) . toBe ( StatusColor . SUCCESS )
8- expect ( formatAtHeadSlotStatus ( - 3 ) ) . toBe ( StatusColor . WARNING )
9- expect ( formatAtHeadSlotStatus ( - 5 ) ) . toBe ( StatusColor . ERROR )
7+ expect ( formatAtHeadSlotStatus ( 1 ) ) . toBe ( StatusColor . SUCCESS )
8+ expect ( formatAtHeadSlotStatus ( 3 ) ) . toBe ( StatusColor . WARNING )
9+ expect ( formatAtHeadSlotStatus ( 5 ) ) . toBe ( StatusColor . ERROR )
1010 expect ( formatAtHeadSlotStatus ( ) ) . toBe ( StatusColor . DARK )
1111 expect ( formatAtHeadSlotStatus ( NaN ) ) . toBe ( StatusColor . DARK )
1212 } )
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ const formatAtHeadSlotStatus = (status?: number): StatusColor => {
44 if ( status === undefined ) return StatusColor . DARK
55
66 switch ( true ) {
7- case status >= - 1 :
7+ case status <= 1 :
88 return StatusColor . SUCCESS
9- case status <= - 2 && status > - 5 :
9+ case status >= 2 && status < 5 :
1010 return StatusColor . WARNING
11- case status <= - 5 :
11+ case status >= 5 :
1212 return StatusColor . ERROR
1313 default :
1414 return StatusColor . DARK
You can’t perform that action at this time.
0 commit comments