From 5085187cbd79be8b8aa40278e105ccb3c9ae3965 Mon Sep 17 00:00:00 2001 From: AndriiSyrotenko Date: Tue, 21 Nov 2023 19:49:35 +0000 Subject: [PATCH] bug fix --- .../Pages/Cards.razor | 64 ++++-------------- .../Pages/Cards.razor.cs | 31 ++++++--- .../Pages/Cart.razor | 10 +-- .../Pages/Cart.razor.cs | 2 +- .../Pages/Chat.razor.cs | 8 ++- .../Services/SearchService.cs | 6 +- .../wwwroot/css/Cards.css | 46 ++++++++++++- .../wwwroot/images/image1.png | Bin 3033 -> 0 bytes .../wwwroot/images/image2.png | Bin 4415 -> 0 bytes 9 files changed, 97 insertions(+), 70 deletions(-) delete mode 100644 ShoppingAssistantWebClient.Web/wwwroot/images/image1.png delete mode 100644 ShoppingAssistantWebClient.Web/wwwroot/images/image2.png diff --git a/ShoppingAssistantWebClient.Web/Pages/Cards.razor b/ShoppingAssistantWebClient.Web/Pages/Cards.razor index d5064d9..1bc92c2 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cards.razor +++ b/ShoppingAssistantWebClient.Web/Pages/Cards.razor @@ -1,39 +1,11 @@ @page "/cards/{wishlistName}/{chatId}" -@inject IJSRuntime JSRuntime @inject NavigationManager navigationManager; - -
@@ -41,20 +13,27 @@

@wishlistName

-
+
@if (Products != null && Products.Count != 0 && currentProduct != Products.Count && currentProduct >= 0) {
- @for(int i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { - string image = Products[currentProduct].ImagesUrls[i]; - if (currentImage == image) { - product image + @if(Products[currentProduct].ImagesUrls.Length > 0) { + @for(int i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { + string image = Products[currentProduct].ImagesUrls[i]; + if (currentImage == image) { + product image + } } + next image + previous image + } + else + { + product image } - next image - previous image +
@for (var i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { @@ -99,10 +78,6 @@
- if(!isProductsNull) { - isProductsNull = true; - StateHasChanged(); - } } else {