Avoid alerts blocking route changes
parent
5a93cca6ef
commit
9f4e0b5fe3
|
@ -239,7 +239,7 @@ else
|
||||||
{
|
{
|
||||||
Game = await GameService.Add(Game);
|
Game = await GameService.Add(Game);
|
||||||
|
|
||||||
await MessageService.Success("Game added!");
|
NavigationManager.LocationChanged += NotifyGameAdded;
|
||||||
|
|
||||||
NavigationManager.NavigateTo($"/Games/{Game.Id}");
|
NavigationManager.NavigateTo($"/Games/{Game.Id}");
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,13 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NotifyGameAdded(object? sender, LocationChangedEventArgs e)
|
||||||
|
{
|
||||||
|
NavigationManager.LocationChanged -= NotifyGameAdded;
|
||||||
|
|
||||||
|
MessageService.Success("Game added!");
|
||||||
|
}
|
||||||
|
|
||||||
private async Task BrowseForIcon()
|
private async Task BrowseForIcon()
|
||||||
{
|
{
|
||||||
var modalOptions = new ModalOptions()
|
var modalOptions = new ModalOptions()
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
{
|
{
|
||||||
Server = await ServerService.Add(Server);
|
Server = await ServerService.Add(Server);
|
||||||
|
|
||||||
await MessageService.Success("Server added!");
|
NavigationManager.LocationChanged += NotifyServerAdded;
|
||||||
|
|
||||||
NavigationManager.NavigateTo($"/Servers/{Server.Id}");
|
NavigationManager.NavigateTo($"/Servers/{Server.Id}");
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NotifyServerAdded(object? sender, LocationChangedEventArgs e)
|
||||||
|
{
|
||||||
|
NavigationManager.LocationChanged -= NotifyServerAdded;
|
||||||
|
|
||||||
|
MessageService.Success("Server added!");
|
||||||
|
}
|
||||||
|
|
||||||
private string GetIcon(Game game)
|
private string GetIcon(Game game)
|
||||||
{
|
{
|
||||||
return $"/api/Games/{game?.Id}/Icon.png";
|
return $"/api/Games/{game?.Id}/Icon.png";
|
||||||
|
|
Loading…
Reference in New Issue