Skip to content

Commit

Permalink
fix: invalid language and lang field default state assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Aug 22, 2024
1 parent 58f37b1 commit f7c1be3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/ui/modals/connect-provider-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,9 @@ export const ConnectProviderModal: React.FC<ConnectProviderModalComponent> = ({
const handleCarrierChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
const target = event.target;
const value = target.value as CarrierNameType;
let state = ["lang", "language"].reduce(
(acc, cur) => {
if (connection_fields[value][cur]?.default) {
return { ...acc, [cur]: connection_fields[value][cur]?.default };
}
return acc;
},
{
carrier_id: `${value.toLocaleLowerCase()}${testMode ? "-test" : ""}`,
},
);
let state = {
carrier_id: `${value.toLocaleLowerCase()}${testMode ? "-test" : ""}`,
};

setCarrierName(value);
dispatch({ name: "full", value: state });
Expand Down

0 comments on commit f7c1be3

Please sign in to comment.