Skip to content

Commit

Permalink
Solving bug with unselect transaction type (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbulgarini authored Sep 17, 2021
1 parent 3934c6d commit 1eebe9a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/screens/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React from 'react';
import { Box, Typography } from '@material-ui/core';
import { ToggleButton, ToggleButtonGroup } from '@material-ui/lab';
import { makeStyles } from '@material-ui/core/styles';
import isNull from 'lodash/isNull';
import { BoxSidebar, BoxUI, ButtonExt, StorageDrawer, MenuAction, NetworkSides, NetworkStats } from '../components';
import CustomCall from '../components/CustomCall';
import Sender from '../components/Sender';
Expand Down Expand Up @@ -55,12 +56,14 @@ function Main() {

const handleOnSwitch = useCallback(
(event: React.MouseEvent<HTMLElement>, isBridged: boolean) => {
setBridged(isBridged);
dispatchTransaction(
TransactionActionCreators.setTransferType(
isBridged ? TransactionTypes.TRANSFER : TransactionTypes.INTERNAL_TRANSFER
)
);
if (!isNull(isBridged)) {
setBridged(isBridged);
dispatchTransaction(
TransactionActionCreators.setTransferType(
isBridged ? TransactionTypes.TRANSFER : TransactionTypes.INTERNAL_TRANSFER
)
);
}
},
[dispatchTransaction, setBridged]
);
Expand Down

0 comments on commit 1eebe9a

Please sign in to comment.