Skip to content

Commit

Permalink
Merge pull request #55527 from etCoderDysto/tax-name
Browse files Browse the repository at this point in the history
fix: Tax name disappears in name editor when the tax name has < symbol
  • Loading branch information
danieldoglas authored Feb 4, 2025
2 parents 2f74857 + 2b2892e commit edd06e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pages/workspace/taxes/NamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {renamePolicyTax, validateTaxName} from '@libs/actions/TaxRate';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import Parser from '@libs/Parser';
import * as PolicyUtils from '@libs/PolicyUtils';
import {getTaxByID} from '@libs/PolicyUtils';
import NotFoundPage from '@pages/ErrorPage/NotFoundPage';
import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper';
import type {WithPolicyAndFullscreenLoadingProps} from '@pages/workspace/withPolicyAndFullscreenLoading';
Expand All @@ -35,12 +34,12 @@ function NamePage({
}: NamePageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const currentTaxRate = PolicyUtils.getTaxByID(policy, taxID);
const currentTaxRate = getTaxByID(policy, taxID);
const {inputCallbackRef} = useAutoFocusInput();

const [name, setName] = useState(() => Parser.htmlToMarkdown(currentTaxRate?.name ?? ''));
const [name, setName] = useState(currentTaxRate?.name ?? '');

const goBack = useCallback(() => Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID ?? '-1', taxID)), [policyID, taxID]);
const goBack = useCallback(() => Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID, taxID)), [policyID, taxID]);

const submit = () => {
const taxName = name.trim();
Expand Down

0 comments on commit edd06e4

Please sign in to comment.