From ba7cf120d0b76e0315e13936511d5af5228e349b Mon Sep 17 00:00:00 2001 From: Sarah Faey Date: Sun, 11 Dec 2022 12:29:43 +0100 Subject: [PATCH] BuildList: added Filter for equipped builds --- Lieb/Pages/GuildWars2/BuildList.razor | 17 ++++++++++++++++- Lieb/Pages/Index.razor | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Lieb/Pages/GuildWars2/BuildList.razor b/Lieb/Pages/GuildWars2/BuildList.razor index 9ecf525..238d716 100644 --- a/Lieb/Pages/GuildWars2/BuildList.razor +++ b/Lieb/Pages/GuildWars2/BuildList.razor @@ -26,7 +26,11 @@ - + + @if (_account != null) + { + + } @@ -161,6 +165,7 @@ private bool _filterAlac = false; private bool _filterQuick = false; private bool _filterMight = false; + private bool _filterEquipped = false; private DamageType? _filterDamageType; protected override async Task OnInitializedAsync() @@ -233,6 +238,12 @@ ApplyFilter(); } + private void EquippedStatusChanged(ChangeEventArgs args) + { + _filterEquipped = bool.Parse(args.Value.ToString()); + ApplyFilter(); + } + private void ApplyFilter() { _buildsToShow = _builds; @@ -256,5 +267,9 @@ { _buildsToShow = _buildsToShow.Where(b => b.DamageType == _filterDamageType).ToList(); } + if(_filterEquipped && _account != null) + { + _buildsToShow = _buildsToShow.Where(b => _account.EquippedBuilds.Where(e => e.GuildWars2BuildId == b.GuildWars2BuildId).Any()).ToList(); + } } } \ No newline at end of file diff --git a/Lieb/Pages/Index.razor b/Lieb/Pages/Index.razor index 3b6b4cf..fdc9468 100644 --- a/Lieb/Pages/Index.razor +++ b/Lieb/Pages/Index.razor @@ -13,6 +13,6 @@

guild icon

- [LIEB] Discord + [LIEB] Discord