Skip to content

Commit

Permalink
Merge pull request #38323 from rayane-djouah/Fix--Save-button-loops-b…
Browse files Browse the repository at this point in the history
…etween-Rate-and-Track-distance-after-refreshing-Rate-page

Fix: Save button loops between Rate/Unit and Track distance after refreshing Rate/Unit page
  • Loading branch information
bondydaa authored Mar 20, 2024
2 parents 399077f + 3551834 commit 873b8d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function WorkspaceRatePage(props: WorkspaceRatePageProps) {
const submit = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_RATE_AND_UNIT_FORM>) => {
const rate = values.rate;
Policy.setRateForReimburseView((parseFloat(rate) * CONST.POLICY.CUSTOM_UNIT_RATE_BASE_OFFSET).toFixed(1));
Navigation.navigate(ROUTES.WORKSPACE_RATE_AND_UNIT.getRoute(props.policy?.id ?? ''));
Navigation.goBack(ROUTES.WORKSPACE_RATE_AND_UNIT.getRoute(props.policy?.id ?? ''));
};

const validate = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function WorkspaceUnitPage(props: WorkspaceUnitPageProps) {

const updateUnit = (unit: UnitItemType) => {
Policy.setUnitForReimburseView(unit.value);
Navigation.navigate(ROUTES.WORKSPACE_RATE_AND_UNIT.getRoute(props.policy?.id ?? ''));
Navigation.goBack(ROUTES.WORKSPACE_RATE_AND_UNIT.getRoute(props.policy?.id ?? ''));
};

const defaultValue = useMemo(() => {
Expand Down

0 comments on commit 873b8d0

Please sign in to comment.