Display error message if script couldn't save. Stop success from blocking dialog close.
parent
78168e94a5
commit
e4531321b1
|
@ -172,15 +172,24 @@
|
|||
|
||||
private async Task Save()
|
||||
{
|
||||
var value = await Editor.GetValue();
|
||||
try
|
||||
{
|
||||
var value = await Editor.GetValue();
|
||||
|
||||
Script.Contents = value;
|
||||
Script.Contents = value;
|
||||
|
||||
if (Script.Id == Guid.Empty)
|
||||
Script = await ScriptService.Add(Script);
|
||||
else
|
||||
Script = await ScriptService.Update(Script);
|
||||
if (Script.Id == Guid.Empty)
|
||||
Script = await ScriptService.Add(Script);
|
||||
else
|
||||
Script = await ScriptService.Update(Script);
|
||||
|
||||
await MessageService.Success("Script saved!");
|
||||
MessageService.Success("Script saved!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageService.Error("Script could not be saved!");
|
||||
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue