diff --git a/src/app/components/cart/components/cart-modal/cart-modal.component.html b/src/app/components/cart/components/cart-modal/cart-modal.component.html index c365131..4368b04 100644 --- a/src/app/components/cart/components/cart-modal/cart-modal.component.html +++ b/src/app/components/cart/components/cart-modal/cart-modal.component.html @@ -357,6 +357,7 @@ nzType="default" [disabled]=" (cartService.getCurrentStep() !== stepType.CONFIRM && + !helper.isExpired(cartService.pendingTransaction$ | async) && cartService.getSelectedNetwork() === item.pricing.tokenSymbol) || (isLoading$ | async) " @@ -364,6 +365,7 @@ nz-tooltip [nzTooltipTitle]=" cartService.getCurrentStep() !== stepType.CONFIRM && + !helper.isExpired(cartService.pendingTransaction$ | async) && cartService.getSelectedNetwork() === item.pricing.tokenSymbol ? 'Item is part of a pending transaction. Please wait for the transaction to expire or be completed before removing this item from the cart.' : (isLoading$ | async) diff --git a/src/app/components/cart/components/cart-modal/cart-modal.component.ts b/src/app/components/cart/components/cart-modal/cart-modal.component.ts index 6b8b5e4..e384b01 100644 --- a/src/app/components/cart/components/cart-modal/cart-modal.component.ts +++ b/src/app/components/cart/components/cart-modal/cart-modal.component.ts @@ -1,12 +1,6 @@ -import { - Component, - OnInit, - OnDestroy, - ChangeDetectorRef, - ChangeDetectionStrategy, -} from '@angular/core'; -import { Network } from '@build-5/interfaces'; -import { Subscription, take, of, Observable } from 'rxjs'; +import { Component, OnDestroy, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core'; +import { Network, Transaction } from '@build-5/interfaces'; +import { Subscription, take, of, Observable, BehaviorSubject } from 'rxjs'; import { CartService, CartItem } from '@components/cart/services/cart.service'; import { AuthService } from '@components/auth/services/auth.service'; import { Router } from '@angular/router'; @@ -14,6 +8,7 @@ import { ROUTER_UTILS } from '@core/utils/router.utils'; import { UnitsService } from '@core/services/units/units.service'; import { map, switchMap, tap } from 'rxjs/operators'; import { DeviceService } from '@core/services/device'; +import { HelperService } from '@pages/nft/services/helper.service'; export enum StepType { CONFIRM = 'Confirm', @@ -58,6 +53,7 @@ export class CartModalComponent implements OnDestroy { private router: Router, public unitsService: UnitsService, public deviceService: DeviceService, + public helper: HelperService, ) {} trackByItemId(index: number, item: CartItem): string { diff --git a/src/app/components/cart/components/checkout/checkout-overlay.component.html b/src/app/components/cart/components/checkout/checkout-overlay.component.html index fcdff46..931e8f0 100644 --- a/src/app/components/cart/components/checkout/checkout-overlay.component.html +++ b/src/app/components/cart/components/checkout/checkout-overlay.component.html @@ -310,7 +310,7 @@

-
+
diff --git a/src/app/components/cart/services/cart.service.ts b/src/app/components/cart/services/cart.service.ts index 946aa09..9609f92 100644 --- a/src/app/components/cart/services/cart.service.ts +++ b/src/app/components/cart/services/cart.service.ts @@ -80,7 +80,7 @@ export class CartService { private currentStepSubject$ = new BehaviorSubject(StepType.CONFIRM); public currentStep$ = this.currentStepSubject$.asObservable(); private checkoutOverlayModalRef: NzModalRef | null = null; - private pendingTransaction$: BehaviorSubject = new BehaviorSubject< + public pendingTransaction$: BehaviorSubject = new BehaviorSubject< Transaction | undefined >(undefined); private memberSpacesSubject$ = new BehaviorSubject([]); diff --git a/src/app/components/nft/components/nft-checkout/nft-checkout.component.html b/src/app/components/nft/components/nft-checkout/nft-checkout.component.html index cd13dce..3c7e742 100644 --- a/src/app/components/nft/components/nft-checkout/nft-checkout.component.html +++ b/src/app/components/nft/components/nft-checkout/nft-checkout.component.html @@ -70,7 +70,7 @@

{{ getTitle() }}

>
Total price @@ -178,7 +178,7 @@

{{ getTitle() }}

Price @@ -188,7 +188,7 @@

{{ getTitle() }}

*ngIf="discount() < 1 && currentStep === stepType.CONFIRM" >
{{ targetPrice | formatToken : collection?.mintingData?.network : true | async @@ -209,7 +209,7 @@

{{ getTitle() }}

}})
-
+
{{ calc(targetPrice, discount()) | formatToken : collection?.mintingData?.network : true @@ -236,7 +236,7 @@

{{ getTitle() }}

class="flex items-center mt-2 text-sm" *ngIf="discount() === 1 || currentStep !== stepType.CONFIRM" > -
+
{{ (currentStep !== stepType.CONFIRM ? pricePerItem : targetPrice) | formatToken : collection?.mintingData?.network : true @@ -265,7 +265,7 @@

{{ getTitle() }}

Quantity @@ -281,7 +281,7 @@

{{ getTitle() }}

Total @@ -291,7 +291,7 @@

{{ getTitle() }}

*ngIf="discount() < 1 && currentStep === stepType.CONFIRM && targetPrice !== null" >
{{ targetPrice * nftQuantity @@ -314,7 +314,7 @@

{{ getTitle() }}

}})
-
+
{{ calc(targetPrice, discount()) * nftQuantity | formatToken : collection?.mintingData?.network : true @@ -344,7 +344,7 @@

{{ getTitle() }}

(currentStep !== stepType.CONFIRM && targetAmount !== null) " > -
+
{{ (currentStep !== stepType.CONFIRM && targetAmount !== null ? targetAmount @@ -396,7 +396,7 @@

{{ getTitle() }}

Target Price @@ -410,7 +410,7 @@

{{ getTitle() }}

Target Amount @@ -424,7 +424,7 @@

{{ getTitle() }}

Quantity Selected @@ -438,7 +438,7 @@

{{ getTitle() }}

Discount @@ -452,7 +452,7 @@

{{ getTitle() }}

Purchase Workflow Step