6db83ccd90
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 4m55s
- Discount store pages (products, cart, orders, order detail) - Blog pages and services - Payment gateway callback page - AppImage component, EmptyState, LoadingState, PageHeader - DiscountCartService, DiscountOrderService, DiscountProductService - BlogCategoryService, BlogPostService, SitePageService, ImageCacheService - PhoneVerifyForm component - Profile Hub page - UI/UX improvements across all pages - landing.js for homepage - Config and routing updates
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using FrontOffice.Main.Utilities;
|
|
|
|
namespace FrontOffice.Main.Pages.Gateway;
|
|
|
|
public partial class StoreChooser : IDisposable
|
|
{
|
|
[Inject] private CartService CartService { get; set; } = default!;
|
|
[Inject] private DiscountCartService DiscountCartService { get; set; } = default!;
|
|
|
|
private int _cartCount;
|
|
private int _discountCartCount;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await CartService.EnsureInitializedAsync();
|
|
await DiscountCartService.EnsureInitializedAsync();
|
|
|
|
_cartCount = CartService.Count;
|
|
_discountCartCount = DiscountCartService.Count;
|
|
|
|
CartService.OnChange += OnCartChanged;
|
|
DiscountCartService.OnChange += OnDiscountCartChanged;
|
|
}
|
|
|
|
private void OnCartChanged()
|
|
{
|
|
_cartCount = CartService.Count;
|
|
InvokeAsync(StateHasChanged);
|
|
}
|
|
|
|
private void OnDiscountCartChanged()
|
|
{
|
|
_discountCartCount = DiscountCartService.Count;
|
|
InvokeAsync(StateHasChanged);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
CartService.OnChange -= OnCartChanged;
|
|
DiscountCartService.OnChange -= OnDiscountCartChanged;
|
|
}
|
|
}
|