Skip to content

Commit

Permalink
front: revert tolerances! in StdcmOrigin and StdcmDestination
Browse files Browse the repository at this point in the history
tolerances are stored in the store and in the local storage. For some users, this field is still undefined in their local storage.
However, since #9977, we assume that tolerances can not be undefined, which is not true if the
users have not reset their store (=clean their cookies) or manullaly filled it.

To prevent the app from crashing when a user without tolerances opens the stdcm page, I revert the changes in StdcmOrigin and StdcmDestination for now.

Signed-off-by: Clara Ni <[email protected]>
  • Loading branch information
clarani committed Dec 12, 2024
1 parent 2c7fe44 commit 9140024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const StdcmDestination = ({ disabled = false }: StdcmConfigCardProps) => {
? extractDateAndTimefromISO(destination.arrival)
: undefined,
destinationToleranceValues: {
arrivalToleranceBefore: destination.tolerances!.before,
arrivalToleranceAfter: destination.tolerances!.after,
arrivalToleranceBefore: destination.tolerances?.before || 0,
arrivalToleranceAfter: destination.tolerances?.after || 0,
},
}),
[destination]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const StdcmOrigin = ({ disabled = false }: StdcmConfigCardProps) => {
() => ({
originArrival: origin.arrival ? extractDateAndTimefromISO(origin.arrival) : undefined,
originToleranceValues: {
arrivalToleranceBefore: origin.tolerances!.before,
arrivalToleranceAfter: origin.tolerances!.after,
arrivalToleranceBefore: origin.tolerances?.before || 0,
arrivalToleranceAfter: origin.tolerances?.after || 0,
},
}),
[origin]
Expand Down

0 comments on commit 9140024

Please sign in to comment.