Skip to content

Commit

Permalink
fix bridge inj
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Jan 9, 2025
1 parent f8c3b82 commit a18f807
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/pages/Balance/TransferConvertToken/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ const TransferConvertToken: FC<TransferConvertProps> = ({

const isBTCLegacy = token?.contractAddress === BTC_CONTRACT;

console.log({ networks });

return (
<div className={classNames(styles.tokenFromGroup, styles.small)} style={{ flexWrap: 'wrap' }}>
<div className={styles.tokenSubAmouts}>
Expand Down
11 changes: 3 additions & 8 deletions src/pages/Balance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const Balance: React.FC<BalanceProps> = () => {
const [isFastMode, setIsFastMode] = useState(true);
const [loadingInspector, setLoadingInspector] = useState(false);
const [toToken, setToToken] = useState<TokenItemType>();
const [toTokens, setToTokens] = useState();
const [toTokens, setToTokens] = useState<any>();

const [filterNetworkUI, setFilterNetworkUI] = useConfigReducer('filterNetwork');
const [hideOtherSmallAmount, setHideOtherSmallAmount] = useConfigReducer('hideOtherSmallAmount');
Expand Down Expand Up @@ -202,8 +202,8 @@ const Balance: React.FC<BalanceProps> = () => {

const loadTokenAmounts = useLoadTokens();
const { data: prices } = useCoinGeckoPrices();
useGetFeeConfig();

useGetFeeConfig();
useEffect(() => {
if (!searchTokenAddress) return setTokens([otherChainTokenCommon, oraichainTokensCommon]);

Expand Down Expand Up @@ -247,10 +247,6 @@ const Balance: React.FC<BalanceProps> = () => {
});
}, []);

// useEffect(() => {
// setTokenBridge([undefined, undefined]);
// }, [filterNetworkUI]);

const processTxResult = (rpc: string, result: DeliverTxResponse, customLink?: string) => {
if (isDeliverTxFailure(result)) {
displayToast(TToastType.TX_FAILED, {
Expand Down Expand Up @@ -645,8 +641,7 @@ const Balance: React.FC<BalanceProps> = () => {
let result: DeliverTxResponse | string | any;
let newToToken = to;

// TODO: @haunv - why we need to find newToToken here?
if (toNetworkChainId && !toToken) {
if (toNetworkChainId && (!toToken || toToken?.chainId !== toNetworkChainId)) {
newToToken = [...otherChainTokens, ...oraichainTokens].find(
(flat) => flat.chainId === toNetworkChainId && flat.coinGeckoId === from.coinGeckoId
);
Expand Down

0 comments on commit a18f807

Please sign in to comment.