From 6fffbe43af66fd24a019be2083a6f34d997b2e54 Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Thu, 28 Mar 2024 16:06:13 +0700 Subject: [PATCH 1/2] update logic cehcking action --- src/pages/iou/request/step/IOURequestStepDistance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepDistance.js b/src/pages/iou/request/step/IOURequestStepDistance.js index dad610cbc636..853df6649be8 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.js +++ b/src/pages/iou/request/step/IOURequestStepDistance.js @@ -84,7 +84,7 @@ function IOURequestStepDistance({ const duplicateWaypointsError = useMemo(() => nonEmptyWaypointsCount >= 2 && _.size(validatedWaypoints) !== nonEmptyWaypointsCount, [nonEmptyWaypointsCount, validatedWaypoints]); const atLeastTwoDifferentWaypointsError = useMemo(() => _.size(validatedWaypoints) < 2, [validatedWaypoints]); const isEditing = action === CONST.IOU.ACTION.EDIT; - const isCreatingNewRequest = Navigation.getActiveRoute().includes('start'); + const isCreatingNewRequest = !(backTo || isEditing) useEffect(() => { MapboxToken.init(); From be217427d410170f50e9122c995590a8ea924e8b Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Thu, 28 Mar 2024 16:15:13 +0700 Subject: [PATCH 2/2] fix lint --- src/pages/iou/request/step/IOURequestStepDistance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepDistance.js b/src/pages/iou/request/step/IOURequestStepDistance.js index 853df6649be8..94b59970b9f3 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.js +++ b/src/pages/iou/request/step/IOURequestStepDistance.js @@ -84,7 +84,7 @@ function IOURequestStepDistance({ const duplicateWaypointsError = useMemo(() => nonEmptyWaypointsCount >= 2 && _.size(validatedWaypoints) !== nonEmptyWaypointsCount, [nonEmptyWaypointsCount, validatedWaypoints]); const atLeastTwoDifferentWaypointsError = useMemo(() => _.size(validatedWaypoints) < 2, [validatedWaypoints]); const isEditing = action === CONST.IOU.ACTION.EDIT; - const isCreatingNewRequest = !(backTo || isEditing) + const isCreatingNewRequest = !(backTo || isEditing); useEffect(() => { MapboxToken.init();