From 20744d09bd6054a89d0302d57823e2b1aedd2d5b Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 29 Jul 2024 16:19:35 +0800 Subject: [PATCH] enhance: set `SuggestedStartLocation` to default clone dir when open local repository (#293) --- src/Views/WelcomeToolbar.axaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Views/WelcomeToolbar.axaml.cs b/src/Views/WelcomeToolbar.axaml.cs index 597d964d..e0a6acfb 100644 --- a/src/Views/WelcomeToolbar.axaml.cs +++ b/src/Views/WelcomeToolbar.axaml.cs @@ -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);