Skip to content

Commit 95ec6e7

Browse files
authored
fix: deadlock on ctrl+N (#1531)
1 parent 6476dbb commit 95ec6e7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/ViewModels/Clone.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,19 @@ public Clone(string pageId)
6666
if (string.IsNullOrEmpty(ParentFolder))
6767
_parentFolder = Preferences.Instance.GitDefaultCloneDir;
6868

69-
try
69+
Task.Run(async () =>
7070
{
71-
var text = App.GetClipboardTextAsync().Result;
72-
if (Models.Remote.IsValidURL(text))
73-
Remote = text;
74-
}
75-
catch
76-
{
77-
// Ignore
78-
}
71+
try
72+
{
73+
var text = await App.GetClipboardTextAsync();
74+
if (Models.Remote.IsValidURL(text))
75+
Remote = text;
76+
}
77+
catch
78+
{
79+
// Ignore
80+
}
81+
});
7982
}
8083

8184
public static ValidationResult ValidateRemote(string remote, ValidationContext _)

0 commit comments

Comments
 (0)