Fixed test data so that jessie actually gets mother and father ids correctly, and fixed search so that it resets visibility every time
This commit is contained in:
@@ -39,18 +39,8 @@ public partial class HomePage : Page
|
||||
|
||||
private void SearchClicked(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(SearchBox.Text))
|
||||
{
|
||||
foreach (var child in CritterStack.Children)
|
||||
{
|
||||
if (child is ProfileButton profileButton)
|
||||
{
|
||||
profileButton.IsVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
ResetCritterStackVisibility();
|
||||
if (string.IsNullOrEmpty(SearchBox.Text)) return;
|
||||
|
||||
foreach (var child in CritterStack.Children)
|
||||
{
|
||||
@@ -60,6 +50,17 @@ public partial class HomePage : Page
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetCritterStackVisibility()
|
||||
{
|
||||
foreach (var child in CritterStack.Children)
|
||||
{
|
||||
if (child is ProfileButton profileButton)
|
||||
{
|
||||
profileButton.IsVisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateHeaderButtons()
|
||||
{
|
||||
var settingsBttn = new Button()
|
||||
|
||||
@@ -48,8 +48,8 @@ public partial class TestPage : Page
|
||||
};
|
||||
await DatabaseService.AddCritter(polities);
|
||||
|
||||
var torielId = DatabaseService.GetCritter("Toriel").Id;
|
||||
var poliId = DatabaseService.GetCritter("Polities").Id;
|
||||
var torielId = (await DatabaseService.GetCritter("Toriel")).Id;
|
||||
var poliId = (await DatabaseService.GetCritter("Polities")).Id;
|
||||
|
||||
var jessie = new Critter
|
||||
{
|
||||
@@ -57,7 +57,8 @@ public partial class TestPage : Page
|
||||
DateOfBirth = new DateTime(2025, 04, 05),
|
||||
Gender = Gender.Male,
|
||||
Notes = "Polities' first son. Named after Jessie from The Last Of Us.",
|
||||
|
||||
MotherId = torielId,
|
||||
FatherId = poliId,
|
||||
};
|
||||
await DatabaseService.AddCritter(jessie);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user