From 10f64ae945170d8f21d6b41a84ba38c7e757ceb5 Mon Sep 17 00:00:00 2001 From: Pujan Date: Thu, 31 Aug 2023 13:43:33 +0530 Subject: [PATCH 1/2] waypoint fix --- src/pages/iou/WaypointEditor.js | 2 +- src/pages/iou/WaypointEditorPage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/WaypointEditor.js b/src/pages/iou/WaypointEditor.js index 8536ff8980e6..56a24a4ad036 100644 --- a/src/pages/iou/WaypointEditor.js +++ b/src/pages/iou/WaypointEditor.js @@ -107,7 +107,7 @@ function WaypointEditor({transactionID, route: {params: {iouType = '', waypointI // If the user is online and they are trying to save a value without using the autocomplete, show an error message instructing them to use a selected address instead. // That enables us to save the address with coordinates when it is selected - if (!isOffline && waypointValue !== '') { + if (!isOffline && waypointValue !== '' && waypointAddress !== waypointValue) { errors[`waypoint${waypointIndex}`] = 'distance.errors.selectSuggestedAddress'; } diff --git a/src/pages/iou/WaypointEditorPage.js b/src/pages/iou/WaypointEditorPage.js index fc659c7806ab..144d6a2eb0d5 100644 --- a/src/pages/iou/WaypointEditorPage.js +++ b/src/pages/iou/WaypointEditorPage.js @@ -47,5 +47,5 @@ WaypointEditorPage.defaultProps = defaultProps; export default withOnyx({ // We must provide a default value for transactionID here, otherwise the component won't mount // because withOnyx returns null until all the keys are defined - transactionID: {key: ONYXKEYS.IOU, selector: (iou) => (iou && iou.transactionID) || ''}, + transactionID: {key: ONYXKEYS.IOU, selector: (iou) => iou && iou.transactionID}, })(WaypointEditorPage); From d15f406784f2f3033d8055af787873e1e13e9836 Mon Sep 17 00:00:00 2001 From: Pujan Date: Thu, 31 Aug 2023 15:18:10 +0530 Subject: [PATCH 2/2] removed comment --- src/pages/iou/WaypointEditorPage.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/iou/WaypointEditorPage.js b/src/pages/iou/WaypointEditorPage.js index 144d6a2eb0d5..51c03623fb50 100644 --- a/src/pages/iou/WaypointEditorPage.js +++ b/src/pages/iou/WaypointEditorPage.js @@ -45,7 +45,5 @@ WaypointEditorPage.displayName = 'WaypointEditorPage'; WaypointEditorPage.propTypes = propTypes; WaypointEditorPage.defaultProps = defaultProps; export default withOnyx({ - // We must provide a default value for transactionID here, otherwise the component won't mount - // because withOnyx returns null until all the keys are defined transactionID: {key: ONYXKEYS.IOU, selector: (iou) => iou && iou.transactionID}, })(WaypointEditorPage);