Fix new scripts not being created
parent
035c98cd18
commit
78168e94a5
|
@ -58,11 +58,18 @@
|
||||||
ICollection<Script> Scripts { get; set; } = new List<Script>();
|
ICollection<Script> Scripts { get; set; } = new List<Script>();
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
await LoadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task LoadData()
|
||||||
{
|
{
|
||||||
if (GameId != Guid.Empty)
|
if (GameId != Guid.Empty)
|
||||||
Scripts = await ScriptService.Get(s => s.GameId == GameId).ToListAsync();
|
Scripts = await ScriptService.Get(s => s.GameId == GameId).ToListAsync();
|
||||||
else if (RedistributableId != Guid.Empty)
|
else if (RedistributableId != Guid.Empty)
|
||||||
Scripts = await ScriptService.Get(s => s.RedistributableId == RedistributableId).ToListAsync();
|
Scripts = await ScriptService.Get(s => s.RedistributableId == RedistributableId).ToListAsync();
|
||||||
|
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Edit(Guid? scriptId = null)
|
private async void Edit(Guid? scriptId = null)
|
||||||
|
@ -89,10 +96,8 @@
|
||||||
|
|
||||||
modalRef.OnOk = async (script) =>
|
modalRef.OnOk = async (script) =>
|
||||||
{
|
{
|
||||||
|
await LoadData();
|
||||||
};
|
};
|
||||||
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Delete(Script script = null)
|
private async void Delete(Script script = null)
|
||||||
|
|
|
@ -85,6 +85,16 @@
|
||||||
{
|
{
|
||||||
if (Options.ScriptId != Guid.Empty)
|
if (Options.ScriptId != Guid.Empty)
|
||||||
Script = await ScriptService.Get(Options.ScriptId);
|
Script = await ScriptService.Get(Options.ScriptId);
|
||||||
|
else if (Options.GameId != Guid.Empty)
|
||||||
|
Script = new Script()
|
||||||
|
{
|
||||||
|
GameId = Options.GameId
|
||||||
|
};
|
||||||
|
else if (Options.RedistributableId != Guid.Empty)
|
||||||
|
Script = new Script()
|
||||||
|
{
|
||||||
|
RedistributableId = Options.RedistributableId
|
||||||
|
};
|
||||||
|
|
||||||
Snippets = ScriptService.GetSnippets();
|
Snippets = ScriptService.GetSnippets();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue