diff --git a/src/ViewModels/ScanRepositories.cs b/src/ViewModels/ScanRepositories.cs index 307694ea..cec932eb 100644 --- a/src/ViewModels/ScanRepositories.cs +++ b/src/ViewModels/ScanRepositories.cs @@ -38,6 +38,12 @@ namespace SourceGit.ViewModels 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(); + Dispatcher.UIThread.Invoke(() => { var normalizedRoot = rootDir.FullName.Replace("\\", "/"); @@ -61,12 +67,6 @@ namespace SourceGit.ViewModels Welcome.Instance.Refresh(); }); - // 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(); - return true; }); } diff --git a/src/Views/PopupRunningStatus.axaml.cs b/src/Views/PopupRunningStatus.axaml.cs index 8a59d87b..05258799 100644 --- a/src/Views/PopupRunningStatus.axaml.cs +++ b/src/Views/PopupRunningStatus.axaml.cs @@ -21,6 +21,15 @@ namespace SourceGit.Views InitializeComponent(); } + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + _isUnloading = false; + if (IsVisible) + StartAnim(); + } + protected override void OnUnloaded(RoutedEventArgs e) { _isUnloading = true;