Fix and harden prospect creation against Blazor runtime crashes
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 3m3s
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 3m3s
- Handle empty numeric input safely with nullable integer binding. - Add semaphore locks to prevent double-click invocation errors on mobile. - Implement global exception handling and user notifications for prospect operations.
This commit is contained in:
@@ -96,15 +96,33 @@ namespace FoodsharingSiegen.Server.Dialogs
|
||||
if (IsUpdateMode)
|
||||
{
|
||||
var updateR = await ProspectService.UpdateAsync(Prospect);
|
||||
if (updateR.Success && OnSuccess != null) await OnSuccess.Invoke();
|
||||
if (updateR.Success)
|
||||
{
|
||||
if (OnSuccess != null) await OnSuccess.Invoke();
|
||||
await ModalService.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Notification.Error(updateR.Exception?.Message ?? "Unbekannter Fehler beim Speichern.", "Fehler");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var addR = await ProspectService.AddProspectAsync(Prospect);
|
||||
if (addR.Success && OnSuccess != null) await OnSuccess.Invoke();
|
||||
if (addR.Success)
|
||||
{
|
||||
if (OnSuccess != null) await OnSuccess.Invoke();
|
||||
await ModalService.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
await Notification.Error(addR.Exception?.Message ?? "Unbekannter Fehler beim Hinzufügen.", "Fehler");
|
||||
}
|
||||
}
|
||||
|
||||
await ModalService.Hide();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Notification.Error(ex.Message, "Systemfehler");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user