Skip to content

Commit d7ffcee

Browse files
chore(runway): cherry-pick fix(predict): stabilize Predict pay-with-any-token quote updates (#30187)
- fix(predict): stabilize Predict pay-with-any-token quote updates cp-7.77.0 (#30064) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This fixes Predict pay-with-any-token quote and CTA timing issues that could appear when users changed payment tokens. The quote trigger previously deduped updates only by amount, so a new transaction or selected token using the same amount could skip `updatePendingAmount` / `updateTokenAmountCallback` and fail to start the quote request. This PR keys those emissions by transaction id, token address, and chain id so the same amount is still emitted when the active transaction or payment token changes. The Predict buy CTA could also remain enabled briefly while the payment selector was closing and before the new quote loading state appeared. This PR adds a Predict-only payment-selector navigation lock in `usePredictBuyConditions`, disables the buy CTA/pay row immediately when the selector opens, and releases the lock one second after the screen regains focus. It also waits for account tokens before defaulting back to Predict balance, avoiding an early fallback while token data is still empty. Finally, this keeps transaction-pay alert text visible in the Predict bottom-sheet flow, including while quote/pay-fee loading is in progress, and persists order-failed banners after the controller refreshes active order state, preventing alert/banner flicker. When a pay-totals alert is returned with fee data, the displayed Total now still includes the deposit fee so users can see the actual amount required by the selected payment token. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Fixed bugs that could prevent Predict pay-with-any-token quotes and alerts from refreshing correctly after changing payment tokens ## **Related issues** Fixes: [PRED-882](https://consensyssoftware.atlassian.net/browse/PRED-882?atlOrigin=eyJpIjoiNTlkZTZkMmI1MTJkNDEyZmE0ZTE5NjUxZmVhNDg1ZjQiLCJwIjoiaiJ9) ## **Manual testing steps** ```gherkin Feature: Predict pay with any token quote refresh Scenario: user changes the payment token before placing a bet Given the Predict pay-with-any-token feature is enabled And the user opens a Predict buy preview with a valid bet amount And an external payment token is selected When the user opens the payment token selector Then the buy CTA is disabled while the selector is open When the user selects a different supported payment token And the selector closes Then the buy CTA remains disabled while the quote refresh starts And the quote request is triggered for the selected token and current bet amount And the buy CTA only becomes enabled after the quote state has settled Scenario: user sees payment and order errors in the Predict bottom sheet Given the user opens a Predict buy preview in bottom-sheet mode When the selected payment token cannot cover the quote Then the transaction-pay alert remains visible When order placement fails Then the order-failed banner remains visible until the user retries, changes the amount, or closes the sheet ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [x] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [x] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- Generated with the help of the pr-description AI skill --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches Predict buy/payment gating, navigation timing, and error surfacing logic; issues could block order placement or hide critical alerts if the new lock/settling conditions misfire. > > **Overview** > **Predict pay-with-any-token quote/CTA timing is hardened.** Adds a payment-selector navigation lock (with 1s delayed unlock + 5s safety timeout) and threads it through `PredictBuyWithAnyToken`/`usePredictBuyConditions` to disable the buy CTA and `PredictPayWithRow` immediately while the selector is opening/closing. > > **Quote settling and emissions are made token/tx-aware.** `usePredictBuyConditions` now treats settling as a *token+chain+amount* key (not just token address), and `PredictPayWithAnyTokenInfo` dedupes `updatePendingAmount`/`updateTokenAmount` by `transactionMeta.id + token address + chainId` so selecting a new token/tx with the same amount still re-triggers quotes. > > **Error UX is refined for sheet mode.** `usePredictBuyError` now returns `errorMessageSource`, prioritizes blocking pay-alert text (even while pay fees load), persists `order_failed` banners across controller refreshes, and clears persisted banners on token change; `PredictBuyWithAnyToken` conditionally suppresses only insufficient-balance helper text in Change Payment/Add Funds modes while keeping blocking pay alerts visible alongside banners. > > **Default token and fee display behavior is adjusted.** `usePredictDefaultPaymentToken` waits for account tokens before falling back, and `usePredictBuyInfo` always computes `depositFee` from `payTotals` (including when pay alerts exist) without caching a “last accepted” fee during confirming. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ea34d01. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> [PRED-882]: https://consensyssoftware.atlassian.net/browse/PRED-882?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [ec66ea6](ec66ea6) [PRED-882]: https://consensyssoftware.atlassian.net/browse/PRED-882?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Caainã Jeronimo <caainaje@gmail.com>
1 parent e0b88b9 commit d7ffcee

15 files changed

Lines changed: 1023 additions & 239 deletions

app/components/UI/Predict/constants/transactions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ export const PREDICT_BALANCE_CHAIN_ID = '0x89' as Hex;
77

88
export const MINIMUM_BET = 1; // $1 minimum bet
99

10+
// Keeps the CTA locked long enough for the payment selector to close and the
11+
// new quote-loading state to arrive, while avoiding a laggy return to the buy
12+
// sheet after normal blur/focus navigation.
13+
export const PAYMENT_SELECTOR_NAVIGATION_UNLOCK_DELAY_MS = 1000;
14+
15+
// Fallback recovery if the payment-selector route does not emit the expected
16+
// blur/focus events, such as transparent modal or interrupted navigation cases.
17+
export const PAYMENT_SELECTOR_NAVIGATION_SAFETY_UNLOCK_MS = 5000;
18+
1019
export const PREDICT_BALANCE_TOKEN_KEY = 'predict-balance';
1120

1221
export const PREDICTION_ERROR_TRANSACTION_BATCH_ID = 'NA';

app/components/UI/Predict/views/PredictBuyWithAnyToken/PredictBuyWithAnyToken.test.tsx

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ let mockFakOrdersEnabled = false;
2424
let mockIsPreviewCalculating = false;
2525
let mockIsPlacingOrder = false;
2626
let mockErrorMessage: string | undefined;
27+
let mockErrorMessageSource:
28+
| 'preview'
29+
| 'below_minimum'
30+
| 'insufficient_balance'
31+
| 'blocking_pay_alert'
32+
| 'order_error'
33+
| undefined;
2734
let mockBuyErrorBanner: {
2835
variant: 'price_changed' | 'order_failed';
2936
title: string;
@@ -155,6 +162,8 @@ jest.mock('./hooks/usePredictBuyInfo', () => ({
155162

156163
let mockIsCurrentTokenInsufficient = false;
157164
let mockHasAlternativeBalance = false;
165+
let mockIsPaymentSelectorNavigationLocked = false;
166+
const mockLockPaymentSelectorNavigation = jest.fn();
158167

159168
jest.mock('./hooks/usePredictBuyConditions', () => ({
160169
usePredictBuyConditions: () => ({
@@ -167,12 +176,15 @@ jest.mock('./hooks/usePredictBuyConditions', () => ({
167176
isCurrentTokenInsufficient: mockIsCurrentTokenInsufficient,
168177
hasAlternativeBalance: mockHasAlternativeBalance,
169178
maxBetAmount: 50,
179+
isPaymentSelectorNavigationLocked: mockIsPaymentSelectorNavigationLocked,
180+
lockPaymentSelectorNavigation: mockLockPaymentSelectorNavigation,
170181
}),
171182
}));
172183

173184
jest.mock('./hooks/usePredictBuyError', () => ({
174185
usePredictBuyError: () => ({
175186
errorMessage: mockErrorMessage,
187+
errorMessageSource: mockErrorMessageSource,
176188
buyErrorBanner: mockBuyErrorBanner,
177189
isOrderNotFilled: false,
178190
resetOrderNotFilled: mockResetOrderNotFilled,
@@ -314,16 +326,24 @@ jest.mock('./components/PredictPayWithAnyTokenInfo', () => {
314326
});
315327

316328
jest.mock('./components/PredictPayWithRow', () => {
317-
const { Text } = jest.requireActual('react-native');
329+
const { Pressable, Text } = jest.requireActual('react-native');
318330
return {
319331
PredictPayWithRow: ({
320332
disabled,
321333
variant,
334+
onPaymentSelectorOpen,
322335
}: {
323336
disabled?: boolean;
324337
variant?: string;
338+
onPaymentSelectorOpen?: () => void;
325339
}) => (
326-
<Text testID="predict-pay-with-row">{`disabled-${String(disabled)} variant-${variant ?? 'default'}`}</Text>
340+
<Pressable
341+
testID="predict-pay-with-row"
342+
disabled={disabled}
343+
onPress={onPaymentSelectorOpen}
344+
>
345+
<Text>{`disabled-${String(disabled)} variant-${variant ?? 'default'}`}</Text>
346+
</Pressable>
327347
),
328348
};
329349
});
@@ -406,9 +426,11 @@ describe('PredictBuyWithAnyToken', () => {
406426
mockIsPreviewCalculating = false;
407427
mockIsPlacingOrder = false;
408428
mockErrorMessage = undefined;
429+
mockErrorMessageSource = undefined;
409430
mockBuyErrorBanner = null;
410431
mockIsCurrentTokenInsufficient = false;
411432
mockHasAlternativeBalance = false;
433+
mockIsPaymentSelectorNavigationLocked = false;
412434
mockUseSelector.mockImplementation((selector) => {
413435
if (typeof selector === 'function') {
414436
return selector({
@@ -476,6 +498,27 @@ describe('PredictBuyWithAnyToken', () => {
476498
);
477499
});
478500

501+
it('locks the buy button when the payment selector opens and unlocks one second after focus returns', () => {
502+
renderWithProvider(<PredictBuyWithAnyToken />);
503+
504+
fireEvent.press(screen.getByTestId('predict-pay-with-row'));
505+
506+
expect(mockLockPaymentSelectorNavigation).toHaveBeenCalledTimes(1);
507+
});
508+
509+
it('uses the payment selector lock condition to disable the buy button and pay row', () => {
510+
mockIsPaymentSelectorNavigationLocked = true;
511+
512+
renderWithProvider(<PredictBuyWithAnyToken />);
513+
514+
expect(screen.getByTestId('predict-buy-action-button')).toHaveTextContent(
515+
/button-disabled-true/,
516+
);
517+
expect(screen.getByTestId('predict-pay-with-row')).toHaveTextContent(
518+
/disabled-true/,
519+
);
520+
});
521+
479522
describe('sheet mode', () => {
480523
const sheetProps = {
481524
mode: 'sheet' as const,
@@ -662,6 +705,7 @@ describe('PredictBuyWithAnyToken', () => {
662705
expect(mockNavigate).toHaveBeenCalledWith(
663706
Routes.CONFIRMATION_PAY_WITH_MODAL,
664707
);
708+
expect(mockLockPaymentSelectorNavigation).toHaveBeenCalledTimes(1);
665709
expect(mockHandleConfirm).not.toHaveBeenCalled();
666710
});
667711

@@ -771,10 +815,11 @@ describe('PredictBuyWithAnyToken', () => {
771815
expect(mockNavigate).not.toHaveBeenCalled();
772816
});
773817

774-
it('suppresses error text in Change Payment Method mode', () => {
818+
it('suppresses insufficient balance helper text in Change Payment Method mode', () => {
775819
mockIsCurrentTokenInsufficient = true;
776820
mockHasAlternativeBalance = true;
777821
mockErrorMessage = 'Not enough funds';
822+
mockErrorMessageSource = 'insufficient_balance';
778823

779824
renderWithProvider(<PredictBuyWithAnyToken {...sheetProps} />);
780825

@@ -783,16 +828,49 @@ describe('PredictBuyWithAnyToken', () => {
783828
);
784829
});
785830

786-
it('suppresses error text in Add Funds mode', () => {
831+
it('suppresses insufficient balance helper text in Add Funds mode', () => {
787832
mockIsCurrentTokenInsufficient = true;
788833
mockHasAlternativeBalance = false;
789834
mockErrorMessage = 'Not enough funds';
835+
mockErrorMessageSource = 'insufficient_balance';
790836

791837
renderWithProvider(<PredictBuyWithAnyToken {...sheetProps} />);
792838

793839
expect(screen.getByTestId('predict-buy-error')).toHaveTextContent(
794840
'no-error',
795841
);
796842
});
843+
844+
it('keeps transaction pay alert text visible in Change Payment Method mode', () => {
845+
mockIsCurrentTokenInsufficient = true;
846+
mockHasAlternativeBalance = true;
847+
mockErrorMessage = 'Add less or use a different token';
848+
mockErrorMessageSource = 'blocking_pay_alert';
849+
850+
renderWithProvider(<PredictBuyWithAnyToken {...sheetProps} />);
851+
852+
expect(screen.getByTestId('predict-buy-error')).toHaveTextContent(
853+
'Add less or use a different token',
854+
);
855+
});
856+
857+
it('keeps transaction pay alert text visible even when a sheet banner exists', () => {
858+
mockErrorMessage = 'Add less or use a different token';
859+
mockErrorMessageSource = 'blocking_pay_alert';
860+
mockBuyErrorBanner = {
861+
variant: 'order_failed',
862+
title: 'Order failed',
863+
description: 'Please retry',
864+
};
865+
866+
renderWithProvider(<PredictBuyWithAnyToken {...sheetProps} />);
867+
868+
expect(screen.getByTestId('predict-buy-error')).toHaveTextContent(
869+
'Add less or use a different token',
870+
);
871+
expect(
872+
screen.getByTestId('predict-buy-preview-order-failed-banner'),
873+
).toBeOnTheScreen();
874+
});
797875
});
798876
});

app/components/UI/Predict/views/PredictBuyWithAnyToken/PredictBuyWithAnyToken.tsx

Lines changed: 86 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,52 @@ import {
6868
predictBuyPreviewSessionRef,
6969
} from '../PredictBuyPreview/PredictBuyPreview';
7070

71+
interface BuyActionButtonStateParams {
72+
isPaymentSelectorNavigationLocked: boolean;
73+
isBannerActive: boolean;
74+
isChangePaymentMode: boolean;
75+
isAddFundsMode: boolean;
76+
isRetrying: boolean;
77+
hasPreview: boolean;
78+
canPlaceBet: boolean;
79+
}
80+
81+
const getBuyActionButtonState = ({
82+
isPaymentSelectorNavigationLocked,
83+
isBannerActive,
84+
isChangePaymentMode,
85+
isAddFundsMode,
86+
isRetrying,
87+
hasPreview,
88+
canPlaceBet,
89+
}: BuyActionButtonStateParams) => {
90+
if (isPaymentSelectorNavigationLocked) {
91+
return {
92+
disabled: true,
93+
reducedOpacity: true,
94+
};
95+
}
96+
97+
if (!isBannerActive && (isChangePaymentMode || isAddFundsMode)) {
98+
return {
99+
disabled: false,
100+
reducedOpacity: false,
101+
};
102+
}
103+
104+
if (isBannerActive) {
105+
return {
106+
disabled: isRetrying || !hasPreview,
107+
reducedOpacity: !hasPreview,
108+
};
109+
}
110+
111+
return {
112+
disabled: !canPlaceBet,
113+
reducedOpacity: !canPlaceBet,
114+
};
115+
};
116+
71117
const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
72118
const tw = useTailwind();
73119
const keypadRef = useRef<PredictKeypadHandles>(null);
@@ -186,19 +232,21 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
186232
hasAlternativeBalance,
187233
maxBetAmount,
188234
isPaySystemSettling,
235+
isPaymentSelectorNavigationLocked,
236+
lockPaymentSelectorNavigation,
189237
} = usePredictBuyConditions({
190238
currentValue,
191239
preview,
192240
isPreviewCalculating,
193241
isUserInputChange,
194242
isConfirming,
195243
totalPayForPredictBalance,
196-
isInputFocused,
197244
hasBlockingPayAlerts,
198245
});
199246

200247
const {
201248
errorMessage,
249+
errorMessageSource,
202250
buyErrorBanner,
203251
isOrderNotFilled,
204252
resetOrderNotFilled,
@@ -227,8 +275,9 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
227275
);
228276

229277
const handleChangePaymentMethod = useCallback(() => {
278+
lockPaymentSelectorNavigation();
230279
navigation.navigate(Routes.CONFIRMATION_PAY_WITH_MODAL);
231-
}, [navigation]);
280+
}, [lockPaymentSelectorNavigation, navigation]);
232281

233282
const handleAddFunds = useCallback(() => {
234283
if (isSheetMode) {
@@ -297,6 +346,10 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
297346
}, [isSheetMode, isBannerActive, isInputFocused, setIsInputFocused]);
298347

299348
const handleBuyButtonPress = useCallback(() => {
349+
if (isPaymentSelectorNavigationLocked) {
350+
return;
351+
}
352+
300353
if (isBannerActive) {
301354
handleRetryWithBestPrice();
302355
return;
@@ -312,6 +365,7 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
312365
handleConfirm();
313366
}, [
314367
isBannerActive,
368+
isPaymentSelectorNavigationLocked,
315369
isChangePaymentMode,
316370
isAddFundsMode,
317371
handleRetryWithBestPrice,
@@ -336,6 +390,26 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
336390
? { twClassName: 'bg-background-default' }
337391
: { style: tw.style('flex-1 bg-background-default') };
338392

393+
const {
394+
disabled: isBuyActionButtonDisabled,
395+
reducedOpacity: showBuyActionButtonReducedOpacity,
396+
} = getBuyActionButtonState({
397+
isPaymentSelectorNavigationLocked,
398+
isBannerActive,
399+
isChangePaymentMode,
400+
isAddFundsMode,
401+
isRetrying,
402+
hasPreview: Boolean(preview),
403+
canPlaceBet,
404+
});
405+
const shouldSuppressInlineError =
406+
(isChangePaymentMode || isAddFundsMode) &&
407+
errorMessageSource === 'insufficient_balance';
408+
const shouldRenderInlineError =
409+
!isSheetMode ||
410+
!buyErrorBanner ||
411+
errorMessageSource === 'blocking_pay_alert';
412+
339413
return (
340414
<Wrapper {...wrapperProps}>
341415
{!isSheetMode && (
@@ -396,16 +470,17 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
396470
hideAvailableBalance={false}
397471
/>
398472
{payWithAnyTokenEnabled && (
399-
<PredictPayWithRow disabled={isPlacingOrder} />
473+
<PredictPayWithRow
474+
disabled={isPlacingOrder || isPaymentSelectorNavigationLocked}
475+
onPaymentSelectorOpen={lockPaymentSelectorNavigation}
476+
/>
400477
)}
401478
</Box>
402479
</ScrollView>
403480
)}
404-
{!(isSheetMode && buyErrorBanner) && (
481+
{shouldRenderInlineError && (
405482
<PredictBuyError
406-
errorMessage={
407-
isChangePaymentMode || isAddFundsMode ? undefined : errorMessage
408-
}
483+
errorMessage={shouldSuppressInlineError ? undefined : errorMessage}
409484
/>
410485
)}
411486
{!isSheetMode && (
@@ -431,9 +506,10 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
431506
)}
432507
{payWithAnyTokenEnabled && isSheetMode && (
433508
<PredictPayWithRow
434-
disabled={isPlacingOrder}
509+
disabled={isPlacingOrder || isPaymentSelectorNavigationLocked}
435510
variant="row"
436511
availableBalance={availableBalanceDisplay}
512+
onPaymentSelectorOpen={lockPaymentSelectorNavigation}
437513
/>
438514
)}
439515
<PredictFeeSummary
@@ -459,20 +535,8 @@ const PredictBuyWithAnyToken = (props: PredictBuyPreviewProps) => {
459535
<PredictBuyActionButton
460536
isLoading={isPlacingOrder || (isBannerActive && isRetrying)}
461537
onPress={handleBuyButtonPress}
462-
disabled={
463-
!isBannerActive && (isChangePaymentMode || isAddFundsMode)
464-
? false
465-
: isBannerActive
466-
? isRetrying || !preview
467-
: !canPlaceBet
468-
}
469-
showReducedOpacity={
470-
!isBannerActive && (isChangePaymentMode || isAddFundsMode)
471-
? false
472-
: isBannerActive
473-
? !preview
474-
: !canPlaceBet
475-
}
538+
disabled={isBuyActionButtonDisabled}
539+
showReducedOpacity={showBuyActionButtonReducedOpacity}
476540
outcomeTokenTitle={outcomeToken?.title}
477541
sharePrice={preview?.sharePrice ?? outcomeToken?.price ?? 0}
478542
isSheetMode={isSheetMode}

0 commit comments

Comments
 (0)