File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const getOpenDTUValueText = (
2727 const valid =
2828 value !== undefined && decimals !== undefined && unit !== undefined ;
2929
30- return valid ? `${ value . toFixed ( decimals ) } ${ unit } ` : textWhenInvalid ?? '' ;
30+ return valid ? `${ value . toFixed ( decimals ) } ${ unit } ` : ( textWhenInvalid ?? '' ) ;
3131} ;
3232
3333const OpenDTUValue : FC < OpenDTUValueProps > = ( {
Original file line number Diff line number Diff line change @@ -261,8 +261,8 @@ const DatabaseProvider: FC<PropsWithChildren> = ({ children }) => {
261261 const inverters = useAppSelector (
262262 state =>
263263 state . settings . selectedDtuConfig !== null
264- ? state . opendtu . dtuStates [ state . settings . selectedDtuConfig ] ?. liveData
265- ?. inverters ?? null
264+ ? ( state . opendtu . dtuStates [ state . settings . selectedDtuConfig ] ?. liveData
265+ ?. inverters ?? null )
266266 : null ,
267267 ( left , right ) =>
268268 left ?. map ( i => i . serial ) . join ( ) === right ?. map ( i => i . serial ) . join ( ) ,
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ class PrometheusDatabase implements Database {
180180 const data = result . values as PrometheusResult [ ] ;
181181
182182 const labelText = labelName
183- ? result . metric . labels [ labelName ] ?? 'unknown'
183+ ? ( result . metric . labels [ labelName ] ?? 'unknown' )
184184 : '' ;
185185
186186 lineChartData . dataSets ?. push ( {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const useTriedToConnect = (): boolean => {
88 return useAppSelector ( state =>
99 index === null
1010 ? false
11- : state . opendtu . dtuStates [ index ] ?. triedToConnect ?? false ,
11+ : ( state . opendtu . dtuStates [ index ] ?. triedToConnect ?? false ) ,
1212 ) ;
1313} ;
1414
Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ const MainScreen: FC<PropsWithNavigation> = ({ navigation }) => {
1717
1818 const deviceName = useAppSelector ( state =>
1919 state . settings . selectedDtuConfig !== null
20- ? ( state . settings . dtuConfigs [ state . settings . selectedDtuConfig ]
20+ ? ( ( state . settings . dtuConfigs [ state . settings . selectedDtuConfig ]
2121 ?. customName ||
2222 state . opendtu . dtuStates [ state . settings . selectedDtuConfig ]
2323 ?. systemStatus ?. hostname ) ??
24- null
24+ null )
2525 : null ,
2626 ) ;
2727
You can’t perform that action at this time.
0 commit comments