This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
GitHub.VisualStudio/Commands Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -16,21 +16,31 @@ public class DialogService : IDialogService
1616 {
1717 readonly IViewViewModelFactory factory ;
1818 readonly IShowDialogService showDialog ;
19+ readonly IGitHubContextService gitHubContextService ;
1920
2021 [ ImportingConstructor ]
2122 public DialogService (
2223 IViewViewModelFactory factory ,
23- IShowDialogService showDialog )
24+ IShowDialogService showDialog ,
25+ IGitHubContextService gitHubContextService )
2426 {
2527 Guard . ArgumentNotNull ( factory , nameof ( factory ) ) ;
2628 Guard . ArgumentNotNull ( showDialog , nameof ( showDialog ) ) ;
29+ Guard . ArgumentNotNull ( showDialog , nameof ( gitHubContextService ) ) ;
2730
2831 this . factory = factory ;
2932 this . showDialog = showDialog ;
33+ this . gitHubContextService = gitHubContextService ;
3034 }
3135
3236 public async Task < CloneDialogResult > ShowCloneDialog ( IConnection connection , string url = null )
3337 {
38+ if ( string . IsNullOrEmpty ( url ) )
39+ {
40+ var clipboardContext = gitHubContextService . FindContextFromClipboard ( ) ;
41+ url = clipboardContext ? . Url ;
42+ }
43+
3444 var viewModel = factory . CreateViewModel < IRepositoryCloneViewModel > ( ) ;
3545 if ( url != null )
3646 {
Original file line number Diff line number Diff line change @@ -41,12 +41,6 @@ public OpenFromUrlCommand(
4141
4242 public override async Task Execute ( string url )
4343 {
44- if ( string . IsNullOrEmpty ( url ) )
45- {
46- var clipboardContext = gitHubContextService . Value . FindContextFromClipboard ( ) ;
47- url = clipboardContext ? . Url ;
48- }
49-
5044 var cloneDialogResult = await dialogService . Value . ShowCloneDialog ( null , url ) ;
5145 if ( cloneDialogResult != null )
5246 {
You can’t perform that action at this time.
0 commit comments