Filter out consoles from monitor menu if they haven't been created

save-path-regex
Pat Hartl 2023-11-05 15:06:08 -06:00
parent 4b40445bac
commit 63ae3a4f2a
1 changed files with 2 additions and 2 deletions

View File

@ -24,9 +24,9 @@
<MenuItem Key="Console" RouterLink="@($"/Servers/{Server.Id}/Monitor/Console")">Console</MenuItem> <MenuItem Key="Console" RouterLink="@($"/Servers/{Server.Id}/Monitor/Console")">Console</MenuItem>
} }
@if (Server.ServerConsoles != null) @if (Server.ServerConsoles != null && Server.ServerConsoles.Any(c => c.Id != Guid.Empty))
{ {
foreach (var log in Server.ServerConsoles) foreach (var log in Server.ServerConsoles.Where(c => c.Id != Guid.Empty))
{ {
<MenuItem Key="@log.Id.ToString()" RouterLink="@($"/Servers/{Server.Id}/Monitor/{log.Id}")">@log.Name</MenuItem> <MenuItem Key="@log.Id.ToString()" RouterLink="@($"/Servers/{Server.Id}/Monitor/{log.Id}")">@log.Name</MenuItem>
} }