Skip to content

Commit

Permalink
fix(Tron): all-network show balance for unsupported wallets (#2248)
Browse files Browse the repository at this point in the history
* fix: tron all-networks not loaded balance for unsupported wallets

* fix: tron all-networks not loaded balance for unsupported wallets

* fix: open external browser
  • Loading branch information
iGroza authored Dec 20, 2024
1 parent 6e714da commit 5d27258
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/models/wallet/wallet.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,18 @@ class WalletStore implements RPCObserver {
return balance;
};

const wallet = this.getById(address);
const balanceModel = BalanceModel.Empty;
let hasEmptyBalance = false;

Provider.getAllNetworks().forEach(p => {
const balance = getBalanceData(p);
// TODO: remove when add support
// skip balance check for unsupported tron wallets
if (p.isTron && !wallet?.isSupportTron) {
return;
}

const balance = getBalanceData(p);
if (!balance) {
hasEmptyBalance = true;
return;
Expand Down
5 changes: 2 additions & 3 deletions src/screens/HomeStack/in-app-browser.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, {memo, useCallback, useRef} from 'react';

import {Share} from 'react-native';
import {Linking, Share} from 'react-native';
import WebView from 'react-native-webview';

import {InAppBrowser} from '@app/components/in-app-browser';
import {openURL} from '@app/helpers';
import {useTypedNavigation, useTypedRoute} from '@app/hooks';
import {HomeStackParamList, HomeStackRoutes} from '@app/route-types';

Expand Down Expand Up @@ -33,7 +32,7 @@ export const InAppBrowserScreen = memo(() => {
}, []);

const onPressBrowser = useCallback((url: string) => {
openURL(url);
Linking.openURL(url);
}, []);

return (
Expand Down

0 comments on commit 5d27258

Please sign in to comment.