mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 18:20:47 +01:00
Fix bug where body template can be incorrect, resolves #5
This commit is contained in:
@@ -73,11 +73,20 @@ namespace Needlework.Net.Desktop.ViewModels
|
|||||||
{
|
{
|
||||||
var type = template[i];
|
var type = template[i];
|
||||||
if (!type.Contains("#")) continue;
|
if (!type.Contains("#")) continue;
|
||||||
if (requestClasses.Where(c => c.Id == type.Replace("#", string.Empty)).Any())
|
|
||||||
|
var foundClass = requestClasses.Where(c => c.Id == type.Replace("#", string.Empty));
|
||||||
|
if (foundClass.Any())
|
||||||
{
|
{
|
||||||
AvaloniaList<PropertyClassViewModel> classes = [.. requestClasses];
|
if (foundClass.First().PropertyEnums.Any())
|
||||||
classes.Remove(rootClass);
|
{
|
||||||
template[i] = string.Join(string.Empty, CreateTemplate(classes));
|
template[i] = string.Join(string.Empty, CreateTemplate([.. foundClass]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AvaloniaList<PropertyClassViewModel> classes = [.. requestClasses];
|
||||||
|
classes.Remove(rootClass);
|
||||||
|
template[i] = string.Join(string.Empty, CreateTemplate(classes));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user