Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for element binding messagebox display on saveas #14424

Merged
merged 10 commits into from
Sep 21, 2023
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ internal void Save(string filePath, bool isBackup = false, EngineController engi
{
// For intentional SaveAs either through UI or API calls, replace workspace elements' Guids and workspace Id
jo["Uuid"] = Guid.NewGuid().ToString();
if (jo["Bindings"] != JToken.Parse("[]"))
if (jo["Bindings"] != null && jo["Bindings"].Any())
{
jo["Bindings"] = JToken.Parse("[]");

Expand Down
3 changes: 2 additions & 1 deletion test/DynamoCoreWpfTests/DynamoViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public void ElementBinding_SaveAs()
File.Delete(filePath);
File.Delete(saveAsPath);
}


[Test]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this unit test was not run before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not.

public void TestToastNotificationClosingBehavior()
{
var preferencesWindow = new PreferencesView(View);
Expand Down