Skip to content

Commit e98a1ca

Browse files
authored
Merge branch 'main' into feat/solana-code-fences
2 parents 8eb86ad + 23c585a commit e98a1ca

File tree

112 files changed

+3112
-2945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3112
-2945
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
- fix(bridge): show "Auto" slippage for Solana swaps
11+
- fix(bridge): add insufficient balance check for Solana swaps
1112

1213
### Added
1314

@@ -46,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4647
- fix(bridge): fix transaction history for EVM and Solana bridge transactions ([#14759](https://github.com/MetaMask/metamask-mobile/pull/14759))
4748
- fix(bridge): change networks properly when user switches between source and destination tokens ([#14812](https://github.com/MetaMask/metamask-mobile/pull/14812))
4849
- fix(bridge): fix(bridge): update quote details card toggle to handle same chain swaps and improve slippage button layout ([#15153](https://github.com/MetaMask/metamask-mobile/pull/15153))
50+
- fix(confirmations): fix the send crash when user puts unexpected address into recipient input([#15308](https://github.com/MetaMask/metamask-mobile/pull/15308))
4951

5052
## [7.45.2]
5153

app/components/Nav/Main/MainNavigator.js

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import SwapsAmountView from '../../UI/Swaps';
5151
import SwapsQuotesView from '../../UI/Swaps/QuotesView';
5252
import CollectiblesDetails from '../../UI/CollectibleModal';
5353
import OptinMetrics from '../../UI/OptinMetrics';
54-
import Drawer from '../../UI/Drawer';
5554

5655
import RampRoutes from '../../UI/Ramp/routes';
5756
import { RampType } from '../../UI/Ramp/types';
@@ -254,8 +253,6 @@ const BrowserFlow = (props) => (
254253
</Stack.Navigator>
255254
);
256255

257-
export const DrawerContext = React.createContext({ drawerRef: null });
258-
259256
///: BEGIN:ONLY_INCLUDE_IF(external-snaps)
260257
const SnapsSettingsStack = () => (
261258
<Stack.Navigator>
@@ -439,7 +436,6 @@ const SettingsFlow = () => (
439436

440437
const HomeTabs = () => {
441438
const { trackEvent, createEventBuilder } = useMetrics();
442-
const drawerRef = useRef(null);
443439
const [isKeyboardHidden, setIsKeyboardHidden] = useState(true);
444440

445441
const accountsLength = useSelector(selectAccountsLength);
@@ -566,41 +562,34 @@ const HomeTabs = () => {
566562
};
567563

568564
return (
569-
<DrawerContext.Provider value={{ drawerRef }}>
570-
<Drawer ref={drawerRef}>
571-
<Tab.Navigator
572-
initialRouteName={Routes.WALLET.HOME}
573-
tabBar={renderTabBar}
574-
>
575-
<Tab.Screen
576-
name={Routes.WALLET.HOME}
577-
options={options.home}
578-
component={WalletTabModalFlow}
579-
/>
580-
<Tab.Screen
581-
name={Routes.TRANSACTIONS_VIEW}
582-
options={options.activity}
583-
component={TransactionsHome}
584-
/>
585-
<Tab.Screen
586-
name={Routes.MODAL.WALLET_ACTIONS}
587-
options={options.actions}
588-
component={WalletTabModalFlow}
589-
/>
590-
<Tab.Screen
591-
name={Routes.BROWSER.HOME}
592-
options={options.browser}
593-
component={BrowserFlow}
594-
/>
595-
596-
<Tab.Screen
597-
name={Routes.SETTINGS_VIEW}
598-
options={options.settings}
599-
component={SettingsFlow}
600-
/>
601-
</Tab.Navigator>
602-
</Drawer>
603-
</DrawerContext.Provider>
565+
<Tab.Navigator initialRouteName={Routes.WALLET.HOME} tabBar={renderTabBar}>
566+
<Tab.Screen
567+
name={Routes.WALLET.HOME}
568+
options={options.home}
569+
component={WalletTabModalFlow}
570+
/>
571+
<Tab.Screen
572+
name={Routes.TRANSACTIONS_VIEW}
573+
options={options.activity}
574+
component={TransactionsHome}
575+
/>
576+
<Tab.Screen
577+
name={Routes.MODAL.WALLET_ACTIONS}
578+
options={options.actions}
579+
component={WalletTabModalFlow}
580+
/>
581+
<Tab.Screen
582+
name={Routes.BROWSER.HOME}
583+
options={options.browser}
584+
component={BrowserFlow}
585+
/>
586+
587+
<Tab.Screen
588+
name={Routes.SETTINGS_VIEW}
589+
options={options.settings}
590+
component={SettingsFlow}
591+
/>
592+
</Tab.Navigator>
604593
);
605594
};
606595

app/components/Nav/Main/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ import { getGlobalEthQuery } from '../../../util/networks/global-network';
9191
import { selectIsEvmNetworkSelected } from '../../../selectors/multichainNetworkController';
9292
import { isPortfolioViewEnabled } from '../../../util/networks';
9393
import { useIdentityEffects } from '../../../util/identity/hooks/useIdentityEffects/useIdentityEffects';
94+
import ProtectWalletMandatoryModal from '../../Views/ProtectWalletMandatoryModal/ProtectWalletMandatoryModal';
95+
import InfoNetworkModal from '../../Views/InfoNetworkModal/InfoNetworkModal';
9496

9597
const Stack = createStackNavigator();
9698

@@ -451,7 +453,9 @@ const Main = (props) => {
451453
toggleSkipCheckbox={toggleSkipCheckbox}
452454
/>
453455
<ProtectYourWalletModal navigation={props.navigation} />
456+
<InfoNetworkModal />
454457
<RootRPCMethodsUI navigation={props.navigation} />
458+
<ProtectWalletMandatoryModal />
455459
</View>
456460
</React.Fragment>
457461
);

app/components/UI/BasicFunctionality/BasicFunctionalityModal/BasicFunctionalityModal.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const mockInitialState = {
1616
engine: {
1717
backgroundState: {
1818
UserStorageController: {
19-
isProfileSyncingEnabled: false,
19+
isBackupAndSyncEnabled: false,
2020
},
2121
NotificationServicesController: {
2222
isNotificationServicesEnabled: false,

app/components/UI/Bridge/Views/BridgeView/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ import { selectSelectedNetworkClientId } from '../../../../../selectors/networkC
6666
import { useMetrics, MetaMetricsEvents } from '../../../../hooks/useMetrics';
6767
import { BridgeToken, BridgeViewMode } from '../../types';
6868
import { useSwitchTokens } from '../../hooks/useSwitchTokens';
69+
import { parseUnits } from 'ethers/lib/utils';
70+
import { BigNumber } from 'ethers';
6971

7072
export interface BridgeRouteParams {
7173
token?: BridgeToken;
@@ -154,7 +156,13 @@ const BridgeView = () => {
154156
const hasValidBridgeInputs =
155157
isValidSourceAmount && !!sourceToken && !!destToken;
156158

157-
const hasInsufficientBalance = quoteRequest?.insufficientBal;
159+
// quoteRequest.insufficientBal is undefined for Solana quotes, so we need to manually check if the source amount is greater than the balance
160+
const hasInsufficientBalance =
161+
quoteRequest?.insufficientBal ||
162+
(isValidSourceAmount &&
163+
parseUnits(sourceAmount, sourceToken.decimals).gt(
164+
latestSourceBalance?.atomicBalance ?? BigNumber.from(0),
165+
));
158166

159167
// Primary condition for keypad visibility - when input is focused or we don't have valid inputs
160168
const shouldDisplayKeypad =

0 commit comments

Comments
 (0)