enhance: returns the instance of ViewModels.Preference directly if it exists

This commit is contained in:
leo 2024-10-09 15:58:44 +08:00
parent bfb97dff72
commit c8a13bc4e9
No known key found for this signature in database

View file

@ -15,16 +15,17 @@ namespace SourceGit.ViewModels
{
get
{
if (_instance == null)
{
_isLoading = true;
_instance = Load();
_isLoading = false;
}
if (_instance != null)
return _instance;
_isLoading = true;
_instance = Load();
_isLoading = false;
_instance.PrepareGit();
_instance.PrepareShellOrTerminal();
_instance.PrepareWorkspaces();
return _instance;
}
}