Skip to content

Commit

Permalink
fix: Unhandled exceptions when trying to delete race trait #37
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystianKempski committed Nov 14, 2024
1 parent 3d2df5a commit fa28ad0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DagoniteEmpire/Pages/Components/RaceComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
{
RaceDTO newRace = AllParams.CurrentRace;

var parameters = new DialogParameters<CreateRaceDialog> { { x => x.NewRace, newRace }};
var parameters = new DialogParameters<CreateRaceDialog> { { x => x.NewRace, newRace },
{ x => x.AllParams, AllParams }};

var dialog = await DialogService.ShowAsync<CreateRaceDialog>("Create custom race", parameters, await SetOptions());
var result = await dialog.Result;
Expand Down
5 changes: 4 additions & 1 deletion DagoniteEmpire/Pages/Dialogs/CreateRaceDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
@if (NewRace.Traits != null)
{
<div class="traits">
<TraitsComponent @bind-Traits="@Traits" TraitType="@TraitType"></TraitsComponent>
<CascadingValue Value="@AllParams">
<TraitsComponent @bind-Traits="@Traits" TraitType="@TraitType"></TraitsComponent>
</CascadingValue>
</div>
}
<label class="warnign-message">@ErrorMessage</label>
Expand All @@ -60,6 +62,7 @@
@code {
[CascadingParameter] MudDialogInstance MudDialog { get; set; } = new();

[Parameter] public AllParamsModel AllParams { get; set; }
[Parameter] public RaceDTO NewRace { get; set; } = new();
[Parameter] public bool IsEdit { get; set; } = false;

Expand Down

0 comments on commit fa28ad0

Please sign in to comment.