Skip to content

Commit

Permalink
fix: more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Mar 22, 2024
1 parent 1fa4dc1 commit 29a2fd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/PolicyDistanceRatesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function validateRateValue(values: FormOnyxValues<RateValueForm>, currency: stri
* @param rates
*/
function getOptimisticRateName(rates: Record<string, Rate>): string {
const existingRatesWithSameName = Object.values(rates).filter((rate) => (rate.name ?? '').startsWith(CONST.CUSTOM_UNITS.DEFAULT_RATE));
const existingRatesWithSameName = Object.values(rates ?? {}).filter((rate) => (rate.name ?? '').startsWith(CONST.CUSTOM_UNITS.DEFAULT_RATE));
return existingRatesWithSameName.length ? `${CONST.CUSTOM_UNITS.DEFAULT_RATE} ${existingRatesWithSameName.length + 1}` : CONST.CUSTOM_UNITS.DEFAULT_RATE;
}

Expand Down
2 changes: 2 additions & 0 deletions src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function CreateDistanceRatePage({policy, route}: CreateDistanceRatePageProps) {
includeSafeAreaPaddingBottom={false}
style={[styles.defaultModalContainer]}
testID={CreateDistanceRatePage.displayName}
shouldEnableMaxHeight
>
<HeaderWithBackButton title={translate('workspace.distanceRates.addRate')} />
<FormProvider
Expand All @@ -82,6 +83,7 @@ function CreateDistanceRatePage({policy, route}: CreateDistanceRatePageProps) {
shouldHideFixErrorsAlert
submitFlexEnabled={false}
submitButtonStyles={[styles.mh5, styles.mt0]}
disablePressOnEnter={false}
>
<InputWrapperWithRef
InputComponent={AmountForm}
Expand Down

0 comments on commit 29a2fd1

Please sign in to comment.