We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Wait
Stopwatch
1 parent ec17ea9 commit 3a1756cCopy full SHA for 3a1756c
1 file changed
src/ViewModels/ScanRepositories.cs
@@ -46,8 +46,7 @@ public override Task<bool> Sure()
46
47
return Task.Run(() =>
48
{
49
- var watch = new Stopwatch();
50
- watch.Start();
+ var delay = Task.Delay(500);
51
52
var rootDir = new DirectoryInfo(_selected.Path);
53
var found = new List<string>();
@@ -57,11 +56,8 @@ public override Task<bool> Sure()
57
56
IgnoreInaccessible = true,
58
});
59
60
- // Make sure this task takes at least 0.5s to avoid that the popup panel do not disappear very quickly.
61
- var remain = 500 - (int)watch.Elapsed.TotalMilliseconds;
62
- watch.Stop();
63
- if (remain > 0)
64
- Task.Delay(remain).Wait();
+ // Make sure this task takes at least 0.5s so the popup panel doesn't disappear too quickly.
+ delay.Wait();
65
66
Dispatcher.UIThread.Invoke(() =>
67
0 commit comments