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

fixed https://github.com/NuGet/Home/issues/1196 #63

Closed
wants to merge 7 commits into from

Conversation

zhili1208
Copy link
Contributor

NuGet/Home#1196

the bug is UI don't show the value of DependencyVersion in config as default.

the fix is during UI loading, it will check DependencyVersion in config, if there is a config setting there, use that as dependency Behavior value.

_detailModel.Options.ShowPreviewWindow = settings.ShowPreviewWindow;
_detailModel.Options.RemoveDependencies = settings.RemoveDependencies;
_detailModel.Options.ForceRemove = settings.ForceRemove;
_topPanel.CheckboxPrerelease.IsChecked = settings.IncludePrerelease;

SetSelectedDepencyBehavior(settings.DependencyBehavior);
SetSelectedDepencyBehavior(GetDependencyBehaviorFromConfig(nugetSettings)?? settings.DependencyBehavior);
Copy link
Member

Choose a reason for hiding this comment

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

To make this easier to debug create a new var for the value before passing it into SetSelectedDepencyBehavior. There should be a space before ?? also.

@emgarten
Copy link
Member

It looks like the null checks for both settings and nugetSettings have been dropped in the new code, shouldn't this be handled still?

@@ -166,6 +166,7 @@ public void ApplyShowPreviewSetting(bool show)
UserSettings settings,
Configuration.ISettings nugetSettings)
{
var dependencySetting = GetDependencyBehaviorFromConfig(nugetSettings);
Copy link
Member

Choose a reason for hiding this comment

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

nugetSettings can be null here, which will throw

@emgarten
Copy link
Member

Configuration.ISettings nugetSettings)
{
if (nugetSettings == null)
Copy link
Member

Choose a reason for hiding this comment

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

It's already returning null at the bottom by default, you can just add this if around the method body to make things more clear

@emgarten
Copy link
Member

🚀

@deepakaravindr
Copy link
Contributor

:shipit:

@zhili1208 zhili1208 closed this Oct 26, 2015
@zhili1208 zhili1208 deleted the fix1196 branch October 27, 2015 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants