Skip to content

Commit

Permalink
DYN-6259 Fix Handling preferences bearing in mind the hosts (#14427) (#…
Browse files Browse the repository at this point in the history
…14431)

* Fix Handling preferences bearing in mind the hosts

* Creating the Preferences on demand

---------

Co-authored-by: jesusalvino <[email protected]>
Co-authored-by: Jesus Alfredo Alviño <[email protected]>
  • Loading branch information
3 people authored Sep 22, 2023
1 parent 255540d commit 62477a1
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ protected DynamoModel(IStartConfiguration config)

OnRequestUpdateLoadBarStatus(new SplashScreenLoadEventArgs(Resources.SplashScreenInitPreferencesSettings, 30));

PreferenceSettings = CreatePreferences(config);
PreferenceSettings = (PreferenceSettings)CreateOrLoadPreferences(config.Preferences);
if (PreferenceSettings != null)
{
PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged;
Expand Down Expand Up @@ -1047,29 +1047,6 @@ internal PathManager CreatePathManager(IStartConfiguration config)
}
}

/// <summary>
/// It returns a PreferenceSettings instance based on the mode in order to reuse it's Singleton instance or create a new one
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
internal PreferenceSettings CreatePreferences(IStartConfiguration config)
{
PreferenceSettings preferences = null;
if (!config.StartInTestMode)
{
if (config.Preferences is PreferenceSettings settings)
{
preferences = settings;
}
}
else
{
preferences = (PreferenceSettings)CreateOrLoadPreferences(config.Preferences);
}

return preferences;
}

/// <summary>
/// Create or load a preference checking the usage mode and if it already exists
/// </summary>
Expand Down

0 comments on commit 62477a1

Please sign in to comment.