Skip to content

Commit 0e6b5bd

Browse files
authored
Merge pull request #120 from ionite34/fix-no-results-found
Fix text display when NSFW mode enabled & you haven't searched yet
2 parents a218e07 + c60b9d5 commit 0e6b5bd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ partial void OnShowNsfwChanged(bool value)
294294
{
295295
settingsManager.SetModelBrowserNsfwEnabled(value);
296296
ModelCardsView?.Refresh();
297+
298+
if (!HasSearched)
299+
return;
300+
297301
UpdateResultsText();
298302
}
299303

@@ -329,8 +333,8 @@ private async Task TrySearchAgain(bool shouldUpdatePageNumber = true)
329333
private void UpdateResultsText()
330334
{
331335
NoResultsFound = ModelCardsView?.IsEmpty ?? true;
332-
NoResultsText = ModelCards?.Count == 0
333-
? "No results found"
334-
: $"{ModelCards?.Count} results hidden by filters";
336+
NoResultsText = ModelCards?.Count > 0
337+
? $"{ModelCards.Count} results hidden by filters"
338+
: "No results found";
335339
}
336340
}

0 commit comments

Comments
 (0)