Skip to content

Commit

Permalink
Fixed quick action to add to list not saving the element.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Mar 15, 2024
1 parent e465e65 commit 1c1cba4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private void AddObjectToListButton_Clicked(object sender, RoutedEventArgs e)
var namedObject = new NamedObjectSave();
namedObject.SetDefaults();
var targetList = GlueState.Self.CurrentNamedObjectSave;
var targetElement = GlueState.Self.CurrentElement;
if(!targetList.IsList)
{
targetList = GlueState.Self.CurrentElement.NamedObjects
Expand Down Expand Up @@ -185,8 +186,8 @@ private void AddObjectToListButton_Clicked(object sender, RoutedEventArgs e)
namedObject.UpdateCustomProperties();
}

GlueCommands.Self.GenerateCodeCommands.GenerateCurrentElementCode();
GlueCommands.Self.RefreshCommands.RefreshTreeNodeFor(GlueState.Self.CurrentElement);
GlueCommands.Self.GenerateCodeCommands.GenerateElementCode(targetElement);
GlueCommands.Self.RefreshCommands.RefreshTreeNodeFor(targetElement);
PluginManager.ReactToNewObject(namedObject);
if(targetList != null)
{
Expand All @@ -195,6 +196,8 @@ private void AddObjectToListButton_Clicked(object sender, RoutedEventArgs e)

GlueState.Self.CurrentNamedObjectSave = namedObject;

GlueCommands.Self.GluxCommands.SaveElementAsync(targetElement);

AnyButtonClicked();
}
}
Expand Down

0 comments on commit 1c1cba4

Please sign in to comment.