PaymentModal: Fix displaying Payment type button (#4170)

This commit is contained in:
Alexander Zinchuk 2024-01-12 13:00:30 +01:00
parent 34fdb278b4
commit a5c38e59cc
4 changed files with 10 additions and 10 deletions

View File

@ -141,7 +141,6 @@ export async function fetchChats({
const chats: ApiChat[] = [];
const draftsById: Record<string, ApiDraft> = {};
const replyingToById: Record<string, number> = {};
const dialogs = (resultPinned ? resultPinned.dialogs : []).concat(result.dialogs);
@ -209,7 +208,6 @@ export async function fetchChats({
users,
userStatusesById,
draftsById,
replyingToById,
orderedPinnedIds: withPinned ? orderedPinnedIds : undefined,
totalChatCount,
};

View File

@ -301,7 +301,7 @@ const PaymentModal: FC<OwnProps & StateProps & GlobalStateProps> = ({
totalPrice={totalPrice}
invoice={invoice}
checkoutInfo={checkoutInfo}
isPaymentFormUrl
isPaymentFormUrl={isPaymentFormUrl}
currency={currency!}
hasShippingOptions={hasShippingOptions}
tipAmount={paymentState.tipAmount}
@ -596,7 +596,8 @@ const PaymentModal: FC<OwnProps & StateProps & GlobalStateProps> = ({
<Transition
name="slide"
activeKey={step}
cleanupKey={PaymentStep.ConfirmPayment}
shouldCleanup
cleanupOnlyKey={PaymentStep.ConfirmPayment}
>
<div className="content custom-scroll">
{renderModalContent(step)}

View File

@ -130,6 +130,7 @@ function preloadProgressive(url: string) {
}, PROGRESSIVE_PRELOAD_DURATION);
}
// eslint-disable-next-line no-async-without-await/no-async-without-await
async function preloadStream(hash: string) {
const loader = makeProgressiveLoader(getProgressiveUrl(hash));
let cachedSize = 0;

View File

@ -10,6 +10,7 @@ import { selectCanAnimateInterface } from '../../global/selectors';
import buildClassName from '../../util/buildClassName';
import { waitForAnimationEnd, waitForTransitionEnd } from '../../util/cssAnimationEndListeners';
import forceReflow from '../../util/forceReflow';
import { omit } from '../../util/iteratees';
import { allowSwipeControlForTransition } from '../../util/swipeController';
import useForceUpdate from '../../hooks/useForceUpdate';
@ -34,7 +35,7 @@ export type TransitionProps = {
shouldRestoreHeight?: boolean;
shouldCleanup?: boolean;
cleanupExceptionKey?: number;
cleanupKey?: number;
cleanupOnlyKey?: number;
// Used by async components which are usually remounted during first animation
shouldWrap?: boolean;
wrapExceptionKey?: number;
@ -74,7 +75,7 @@ function Transition({
shouldRestoreHeight,
shouldCleanup,
cleanupExceptionKey,
cleanupKey,
cleanupOnlyKey,
shouldWrap,
wrapExceptionKey,
id,
@ -122,13 +123,12 @@ function Transition({
useLayoutEffect(() => {
function cleanup() {
if (!shouldCleanup) {
if (cleanupKey !== undefined) {
delete rendersRef.current[cleanupKey];
}
return;
}
if (cleanupExceptionKey !== undefined) {
rendersRef.current = { [cleanupExceptionKey]: rendersRef.current[cleanupExceptionKey] };
} else if (cleanupOnlyKey !== undefined) {
rendersRef.current = omit(rendersRef.current, [cleanupOnlyKey]);
} else {
rendersRef.current = {};
}
@ -317,7 +317,7 @@ function Transition({
shouldDisableAnimation,
forceUpdate,
withSwipeControl,
cleanupKey,
cleanupOnlyKey,
]);
useEffect(() => {