Skip to content

Commit

Permalink
fix: reloading page at campaign fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystianKempski committed Nov 21, 2024
1 parent dd56750 commit ddebfdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions DagoniteEmpire/Pages/Chat/CampaignList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -148,31 +148,22 @@

if (UserInfo.CharacterMG == true)
{

Title = "All avalible campaingns";
Campaigns = (await _campaignRepository.GetAll()).ToList();
}
else
{
Title = "Characters of " + UserInfo?.UserName;
Characters = await _characterRepository.GetAllApproved(UserInfo?.UserName);
if (Characters.Any())
{
if (UserInfo?.SelectedCharacter is not null)
Campaigns = (await _campaignRepository.GetAll(UserInfo.SelectedCharacter.Id)).ToList();
}
if (UserInfo?.SelectedCharacter is not null && UserInfo?.SelectedCharacter.Id > 0)
Campaigns = (await _campaignRepository.GetAll(UserInfo.SelectedCharacter.Id)).ToList();

}
}
else
{
Title = "Characters of " + UserInfo?.UserName;
Characters = await _characterRepository.GetAllApproved(UserInfo?.UserName);
if (Characters.Any())
if (UserInfo?.SelectedCharacter is not null && UserInfo?.SelectedCharacter.Id > 0 )
{
Campaigns = (await _campaignRepository.GetAll(UserInfo?.SelectedCharacter?.Id)).ToList();
}


}
IsLoading = false;
StateHasChanged();
Expand Down
2 changes: 1 addition & 1 deletion DagoniteEmpire/Pages/Chat/ChapterThread.razor
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ else
{
SendPostEnabled = true;
NewPost.Content = string.Empty;
_navigationManager.NavigateTo($"/chapter/{Id}");
//_navigationManager.NavigateTo($"/chapter/{Id}");
}
_scrollDown = true;
IsLoading = false;
Expand Down

0 comments on commit ddebfdf

Please sign in to comment.