Skip to content

Commit

Permalink
refactor: switch statement expects a constant expression
Browse files Browse the repository at this point in the history
  • Loading branch information
shontzu-deriv committed Jun 8, 2023
1 parent 40e9b94 commit e3a26ab
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ const MT5AccountTypeModal = () => {
const is_swapfree_available = useHasSwapFreeAccount();

const set_account_type = () => {
switch (localize(account_type_card)) {
const localizedAccountType = localize(account_type_card);

switch (localizedAccountType) {
case localize('Derived'):
setAccountType({ category: 'real', type: 'synthetic' });
break;
case localize('Swap-Free'):
case localize('Swap-Free') || localize('Swap Free'):
setAccountType({ category: 'real', type: 'all' });
break;
case localize('Financial'):
Expand All @@ -122,6 +124,7 @@ const MT5AccountTypeModal = () => {
break;
}
};

return (
<div>
<React.Suspense fallback={<UILoader />}>
Expand Down

0 comments on commit e3a26ab

Please sign in to comment.