Skip to content

Commit

Permalink
revert hard code and rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Feb 2, 2024
1 parent 2d90382 commit 53e3ae8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
const shouldCalculateDistanceAmount = isDistanceRequest && iouAmount === 0;

// A flag for showing the categories field
const shouldShowCategories = iouCategory || OptionsListUtils.hasEnabledOptions(_.values(policyCategories));
const shouldShowCategories = isPolicyExpenseChat && (iouCategory || OptionsListUtils.hasEnabledOptions(_.values(policyCategories)));

// A flag and a toggler for showing the rest of the form fields
const [shouldExpandFields, toggleShouldExpandFields] = useReducer((state) => !state, false);
Expand Down
23 changes: 14 additions & 9 deletions src/pages/iou/request/step/IOURequestStepTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function IOURequestStepTag({
const tagListKey = _.first(_.keys(policyTags));
const policyTagListName = PolicyUtils.getTagListName(policyTags) || translate('common.tag');
const isEditing = action === CONST.IOU.ACTION.EDIT;
const isBillSplit = iouType === CONST.IOU.TYPE.SPLIT;
const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT;

const navigateBack = () => {
Navigation.goBack(backTo || ROUTES.HOME);
Expand All @@ -69,7 +69,7 @@ function IOURequestStepTag({
const updateTag = (selectedTag) => {
const isSelectedTag = selectedTag.searchText === tag;
const updatedTag = !isSelectedTag ? selectedTag.searchText : '';
if (isBillSplit) {
if (isSplitBill) {
IOU.setDraftSplitTransaction(transactionID, {tag: selectedTag.searchText});
navigateBack();
return;
Expand All @@ -90,13 +90,18 @@ function IOURequestStepTag({
shouldShowWrapper
testID={IOURequestStepTag.displayName}
>
<Text style={[styles.ph5, styles.pv3]}>{translate('iou.tagSelection', {tagName: policyTagListName})}</Text>
<TagPicker
policyID={report.policyID}
tag={tagListKey}
selectedTag={tag || ''}
onSubmit={updateTag}
/>
{({insets}) => (
<>
<Text style={[styles.ph5, styles.pv3]}>{translate('iou.tagSelection', {tagName: policyTagListName})}</Text>
<TagPicker
policyID={report.policyID}
tag={tagListKey}
selectedTag={tag || ''}
onSubmit={updateTag}
insets={insets}
/>
</>
)}
</StepScreenWrapper>
);
}
Expand Down

0 comments on commit 53e3ae8

Please sign in to comment.