Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/ViewModels/ScanRepositories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public override Task<bool> Sure()

return Task.Run(() =>
{
var watch = new Stopwatch();
watch.Start();
var delay = Task.Delay(500);

var rootDir = new DirectoryInfo(_selected.Path);
var found = new List<string>();
Expand All @@ -57,11 +56,8 @@ public override Task<bool> Sure()
IgnoreInaccessible = true,
});

// Make sure this task takes at least 0.5s to avoid that the popup panel do not disappear very quickly.
var remain = 500 - (int)watch.Elapsed.TotalMilliseconds;
watch.Stop();
if (remain > 0)
Task.Delay(remain).Wait();
// Make sure this task takes at least 0.5s so the popup panel doesn't disappear too quickly.
delay.Wait();

Dispatcher.UIThread.Invoke(() =>
{
Expand Down