From f00994335d5a538d3a4d8dbb0b7c31267b98ab09 Mon Sep 17 00:00:00 2001 From: krystian kempski Date: Wed, 20 Nov 2024 21:15:20 +0100 Subject: [PATCH] fix: Crash when adding money to purse #45 --- .../Pages/Components/EquipmentComponent.razor | 3 +++ .../Pages/Components/TraitsComponent.razor | 25 ++++--------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/DagoniteEmpire/Pages/Components/EquipmentComponent.razor b/DagoniteEmpire/Pages/Components/EquipmentComponent.razor index ad12a69..f80ddf9 100644 --- a/DagoniteEmpire/Pages/Components/EquipmentComponent.razor +++ b/DagoniteEmpire/Pages/Components/EquipmentComponent.razor @@ -82,6 +82,8 @@
+ @if (AllParams?.Character is not null && AllParams?.Character.Id > 0) + { @@ -91,6 +93,7 @@ @* Records *@ + }
diff --git a/DagoniteEmpire/Pages/Components/TraitsComponent.razor b/DagoniteEmpire/Pages/Components/TraitsComponent.razor index b9f83c4..ea30060 100644 --- a/DagoniteEmpire/Pages/Components/TraitsComponent.razor +++ b/DagoniteEmpire/Pages/Components/TraitsComponent.razor @@ -148,18 +148,9 @@ } private async Task AddWeaponQualities() { - NewTrait = CreateNewTrait(); - // var weaponPropertyTrait = Traits.FirstOrDefault(t => t.Name == SD.WeaponParametersDescr); - // bool editMode = false; - // if (weaponPropertyTrait is not null) - // { - // editMode = true; - // NewTrait = new TraitEquipmentDTO(weaponPropertyTrait,null); - // } - // else - // { - NewTrait = new TraitEquipmentDTO(); - //} + + NewTrait = new TraitEquipmentDTO(); + var parameters = new DialogParameters { { x => x.NewTrait, NewTrait }, { x => x.IsWeaponQualityMode, true }, { x => x.AllParams, AllParams } }; @@ -170,14 +161,8 @@ if (!result.Canceled) { NewTrait = (TraitDTO)result.Data; - // if (editMode) - // { - // weaponPropertyTrait = NewTrait; - // } - // else - // { - Traits.Add(NewTrait); - // } + Traits.Add(NewTrait); + await UpdateTraits(); } }