diff --git a/package-lock.json b/package-lock.json index 47a68e79b..8aa677def 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "react-native-elements": "^3.4.2", "react-native-gesture-handler": "^2.8.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", - "react-native-localize": "^2.2.4", + "react-native-localize": "2.2.4", "react-native-location": "^2.5.0", "react-native-map-clustering": "^3.4.2", "react-native-map-link": "^2.10.2", diff --git a/package.json b/package.json index 0f9adf9ad..33fa1bd39 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "react-native-elements": "^3.4.2", "react-native-gesture-handler": "^2.8.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", - "react-native-localize": "^2.2.4", + "react-native-localize": "2.2.4", "react-native-location": "^2.5.0", "react-native-map-clustering": "^3.4.2", "react-native-map-link": "^2.10.2", diff --git a/src/screens/charging-stations/connector-details/ChargingStationConnectorDetails.tsx b/src/screens/charging-stations/connector-details/ChargingStationConnectorDetails.tsx index 5e45bc2cc..4d9d958cf 100644 --- a/src/screens/charging-stations/connector-details/ChargingStationConnectorDetails.tsx +++ b/src/screens/charging-stations/connector-details/ChargingStationConnectorDetails.tsx @@ -262,7 +262,7 @@ export default class ChargingStationConnectorDetails extends BaseAutoRefreshScre return transaction; } catch (error) { // Check if HTTP? - if (!error.request || error.request.status !== HTTPAuthError.FORBIDDEN) { + if (!error.request || error.request.status !== StatusCodes.FORBIDDEN) { await Utils.handleHttpUnexpectedError( this.centralServerProvider, error, @@ -367,7 +367,7 @@ export default class ChargingStationConnectorDetails extends BaseAutoRefreshScre siteImage = await this.getSiteImage(chargingStation?.siteArea?.siteID); } // Get Current Transaction - if (connector?.currentTransactionID) { + if (connector?.currentTransactionID && connector?.canReadTransaction) { transaction = await this.getTransaction(connector.currentTransactionID); } // // Compute Duration @@ -1150,7 +1150,6 @@ export default class ChargingStationConnectorDetails extends BaseAutoRefreshScre ); } - // TODO reload session context when changing car (at least to check again the availability of car connector) private renderCarSelection(style: any) { const { navigation } = this.props; const { sessionContextLoading, selectedUser, selectedCar, connector } = this.state; diff --git a/src/screens/transactions/chart/TransactionChart.tsx b/src/screens/transactions/chart/TransactionChart.tsx index 33ecd06d4..755c3b7b9 100644 --- a/src/screens/transactions/chart/TransactionChart.tsx +++ b/src/screens/transactions/chart/TransactionChart.tsx @@ -10,7 +10,6 @@ import TransactionHeaderComponent from '../../../components/transaction/header/T import BaseProps from '../../../types/BaseProps'; import ChargingStation, { Connector } from '../../../types/ChargingStation'; import Consumption from '../../../types/Consumption'; -import { HTTPAuthError } from '../../../types/HTTPError'; import Transaction from '../../../types/Transaction'; import Constants from '../../../utils/Constants'; import Utils from '../../../utils/Utils'; @@ -19,6 +18,7 @@ import computeStyleSheet from './TransactionChartStyles'; import { HttpChargingStationRequest } from '../../../types/requests/HTTPChargingStationRequests'; import I18nManager, { NumberFormatStyleEnum } from '../../../I18n/I18nManager'; import DurationUnitFormat from 'intl-unofficial-duration-unit-format'; +import {StatusCodes} from 'http-status-codes'; export interface Props extends BaseProps {} @@ -90,7 +90,7 @@ export default class TransactionChart extends BaseAutoRefreshScreen