Skip to content

Commit

Permalink
feat(container): added aggreements modal and reviewed modals display
Browse files Browse the repository at this point in the history
ref: MANAGER-14722

Signed-off-by: Jacques Larique <[email protected]>
  • Loading branch information
Jacques Larique committed Nov 12, 2024
1 parent 25e78fa commit a3479a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const IdentityDocumentsModal: FunctionComponent = () => {
setStorage(true);
trackingPlugin.trackClick({
name: `${trackingPrefix}::pop-up::link::kyc::cancel`,
type: 'action',
...trackingContext,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ interface IPaymentMethod {
paymentMethodId: number;
}

const computeAlert = (paymentMethods: IPaymentMethod[]): string => {
const currentCreditCard: IPaymentMethod = paymentMethods?.find(currentPaymentMethod => currentPaymentMethod.paymentType === 'CREDIT_CARD'
const computeAlert = (paymentMethods: IPaymentMethod[] =[]): string => {
const currentCreditCard: IPaymentMethod = paymentMethods.find(currentPaymentMethod => currentPaymentMethod.paymentType === 'CREDIT_CARD'
&& currentPaymentMethod.default);

if (currentCreditCard) {
Expand Down Expand Up @@ -83,19 +83,16 @@ const PaymentModal = (): JSX.Element => {
});

useEffect(() => {
if (paymentResponse) {
const alert = computeAlert(paymentResponse.data);
if (isReadyToRequest && !isLoading) {
const alert = computeAlert(paymentResponse?.data);
if (alert) {
setAlert(alert);
setShowPaymentModal(true);
}
else if (isReadyToRequest) {
else {
shell.getPlugin('ux').notifyModalActionDone();
}
}
else if (isReadyToRequest && !isLoading) {
shell.getPlugin('ux').notifyModalActionDone();
}
}, [paymentResponse, isReadyToRequest, isLoading]);

return !showPaymentModal ? (
Expand Down

0 comments on commit a3479a6

Please sign in to comment.