Skip to content

Commit 2219485

Browse files
committed
Better
1 parent 94d041f commit 2219485

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Damselfly.Core/Services/SearchQueryService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ private async Task<SearchResponse> LoadMoreData(SearchQuery query, int first, in
295295
// Set the results on the service property
296296
response.SearchResults = enrichedImages.Select(x => x.ImageId).ToArray();
297297

298+
if( System.Diagnostics.Debugger.IsAttached )
299+
await Task.Delay( 2 * 1000 );
300+
298301
return response;
299302
}
300303

Damselfly.Web.Client/Components/ImageBrowser/ImageGrid.razor

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
else
2424
{
25-
<ProgressSpinner ProgressText="@ResultsMessage"/>
25+
<ProgressSpinner ProgressText="Loading images..."/>
2626
}
2727
}
2828
else
@@ -97,7 +97,6 @@
9797

9898
[Parameter] public GridImageSize CurrentGridSize { get; set; }
9999

100-
private string ResultsMessage { get; set; }
101100
private bool NoResultsFound { get; set; } = true;
102101

103102
async Task AddGroupToBasket(ImageGrouping grouping)
@@ -235,8 +234,8 @@
235234
{
236235
// If we've tried to load data and there isn't any more, show the toast.
237236
toastClass = endOfImages ? "show" : string.Empty;
238-
239-
_ = AddImagesToGrid(response);
237+
238+
_ = AddImagesToGrid(response.MoreDataAvailable);
240239
}
241240

242241
protected void SearchQueryChanged()
@@ -261,13 +260,12 @@
261260
await searchService.LoadMore();
262261
}
263262

264-
private async Task AddImagesToGrid(SearchResponse response)
263+
private async Task AddImagesToGrid(bool moreDataAvailable)
265264
{
266265
NoResultsFound = true;
267266

268267
if ( searchService.SearchResults.Any() )
269268
{
270-
ResultsMessage = $"Found {response.SearchResults.Count()} images...";
271269
NoResultsFound = false;
272270

273271
foreach( var set in searchService.SearchResults.Chunk(25) )
@@ -287,7 +285,7 @@
287285
}
288286

289287
// Flag the 'more' div if we loaded at least as many as we requested.
290-
endOfImages = !response.MoreDataAvailable;
288+
endOfImages = !moreDataAvailable;
291289
StateHasChanged();
292290
}
293291

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const CACHE_VERSION='4.2.1-20241230151834'
1+
const CACHE_VERSION='4.2.1-20241230153611'

0 commit comments

Comments
 (0)