don't apply changes when no changes
This commit is contained in:
@@ -29,16 +29,19 @@ public class NameplateElementChange(NameplateElements element, INamePlateUpdateH
|
|||||||
|
|
||||||
public void ApplyChanges()
|
public void ApplyChanges()
|
||||||
{
|
{
|
||||||
StringUpdateFactory.ApplyStringChanges(new()
|
if (Changes.Any())
|
||||||
{
|
{
|
||||||
StringChanges = Changes,
|
StringUpdateFactory.ApplyStringChanges(new()
|
||||||
Destination = element switch
|
|
||||||
{
|
{
|
||||||
NameplateElements.Name => handler.NameParts.Text ??= handler.InfoView.Name,
|
StringChanges = Changes,
|
||||||
NameplateElements.Title => handler.TitleParts.Text ??= handler.InfoView.Title,
|
Destination = element switch
|
||||||
NameplateElements.FreeCompany => handler.FreeCompanyTagParts.Text ??= handler.InfoView.FreeCompanyTag,
|
{
|
||||||
_ => null,
|
NameplateElements.Name => handler.NameParts.Text ??= handler.InfoView.Name,
|
||||||
},
|
NameplateElements.Title => handler.TitleParts.Text ??= handler.InfoView.Title,
|
||||||
});
|
NameplateElements.FreeCompany => handler.FreeCompanyTagParts.Text ??= handler.InfoView.FreeCompanyTag,
|
||||||
|
_ => null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user