diff --git a/app/components/Nav/Main/MainNavigator.js b/app/components/Nav/Main/MainNavigator.js index 97a4a62f0acd..703a68aad012 100644 --- a/app/components/Nav/Main/MainNavigator.js +++ b/app/components/Nav/Main/MainNavigator.js @@ -942,8 +942,8 @@ const MainNavigator = () => { // Get feature flag state for conditional Predict screen registration const predictEnabledFlag = useSelector(selectPredictEnabledFlag); const isPredictEnabled = useMemo( - () => predictEnabledFlag && isEvmSelected, - [predictEnabledFlag, isEvmSelected], + () => predictEnabledFlag, + [predictEnabledFlag], ); const { enabled: isSendRedesignEnabled } = useSelector( selectSendRedesignFlags, diff --git a/app/components/Views/ActivityView/index.js b/app/components/Views/ActivityView/index.js index 0b3dffb0abe9..52e238d57ea5 100644 --- a/app/components/Views/ActivityView/index.js +++ b/app/components/Views/ActivityView/index.js @@ -184,8 +184,8 @@ const ActivityView = () => { const [activeTabIndex, setActiveTabIndex] = useState(0); const predictEnabledFlag = useSelector(selectPredictEnabledFlag); const isPredictEnabled = useMemo( - () => predictEnabledFlag && isEvmSelected, - [predictEnabledFlag, isEvmSelected], + () => predictEnabledFlag, + [predictEnabledFlag], ); const openAccountSelector = useCallback(() => { @@ -254,7 +254,7 @@ const ActivityView = () => { // Calculate if Perps tab is currently active // Perps is the last tab, so its index depends on what other tabs are shown const perpsTabIndex = 2; - const predictTabIndex = 3; + const predictTabIndex = isPerpsEnabled ? 3 : 2; const isPerpsTabActive = isPerpsEnabled && activeTabIndex === perpsTabIndex; const isPredictTabActive = isPredictEnabled && activeTabIndex === predictTabIndex; diff --git a/app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx b/app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx index f51ccdce61b9..60fc6a1fe204 100644 --- a/app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx +++ b/app/components/Views/TradeWalletActions/TradeWalletActions.test.tsx @@ -627,7 +627,7 @@ describe('TradeWalletActions', () => { expect(mockOnDismiss).not.toHaveBeenCalled(); }); - it('should not show Predict button on non-EVM networks', () => { + it('should show Predict button on non-EVM networks', () => { ( selectPredictEnabledFlag as jest.MockedFunction< typeof selectPredictEnabledFlag @@ -643,7 +643,7 @@ describe('TradeWalletActions', () => { ...mockInitialState, }; - const { queryByTestId } = renderScreen( + const { getByTestId } = renderScreen( TradeWalletActions, { name: 'TradeWalletActions', @@ -654,7 +654,7 @@ describe('TradeWalletActions', () => { ); expect( - queryByTestId(WalletActionsBottomSheetSelectorsIDs.PREDICT_BUTTON), - ).toBeNull(); + getByTestId(WalletActionsBottomSheetSelectorsIDs.PREDICT_BUTTON), + ).toBeOnTheScreen(); }); }); diff --git a/app/components/Views/TradeWalletActions/TradeWalletActions.tsx b/app/components/Views/TradeWalletActions/TradeWalletActions.tsx index f61e5d35ba9c..60515e9ab3b0 100644 --- a/app/components/Views/TradeWalletActions/TradeWalletActions.tsx +++ b/app/components/Views/TradeWalletActions/TradeWalletActions.tsx @@ -287,7 +287,7 @@ function TradeWalletActions() { isDisabled={!canSignTransactions} /> )} - {isPredictEnabled && isEvmSelected && ( + {isPredictEnabled && (