enhance: set SuggestedStartLocation to default clone dir when open local repository (#293)

This commit is contained in:
leo 2024-07-29 16:19:35 +08:00
parent efa02d9e96
commit 20744d09bd
No known key found for this signature in database

View file

@ -24,6 +24,12 @@ namespace SourceGit.Views
return;
var options = new FolderPickerOpenOptions() { AllowMultiple = false };
if (Directory.Exists(ViewModels.Preference.Instance.GitDefaultCloneDir))
{
var folder = await topLevel.StorageProvider.TryGetFolderFromPathAsync(ViewModels.Preference.Instance.GitDefaultCloneDir);
options.SuggestedStartLocation = folder;
}
var selected = await topLevel.StorageProvider.OpenFolderPickerAsync(options);
if (selected.Count == 1)
OpenOrInitRepository(selected[0].Path.LocalPath);