diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 6963d81c9..f96509bde 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -327,6 +327,7 @@ Are you sure you want to delete all logs? Clear Caches Are you sure you want to delete all caches? + Failed to clear folders and files Wizard User Data Location User settings and installed plugins are saved in the user data folder. This location may vary depending on whether it's in portable mode or not. diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs index 47cb1b6c3..1cd90e613 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs @@ -103,7 +103,15 @@ public partial class SettingsPaneAboutViewModel : BaseModel if (confirmResult == MessageBoxResult.Yes) { - ClearLogFolder(); + try + { + ClearLogFolder(); + } + catch (Exception e) + { + App.API.LogException(nameof(SettingsPaneAboutViewModel), "Failed to clear log folder", e); + App.API.ShowMsgBox(App.API.GetTranslation("clearfolderfailMessage")); + } } } @@ -118,7 +126,15 @@ public partial class SettingsPaneAboutViewModel : BaseModel if (confirmResult == MessageBoxResult.Yes) { - ClearCacheFolder(); + try + { + ClearCacheFolder(); + } + catch (Exception e) + { + App.API.LogException(nameof(SettingsPaneAboutViewModel), "Failed to clear cache folder", e); + App.API.ShowMsgBox(App.API.GetTranslation("clearfolderfailMessage")); + } } } @@ -202,8 +218,7 @@ public partial class SettingsPaneAboutViewModel : BaseModel foreach (string order in orders) { - if (bytes > max) - return $"{decimal.Divide(bytes, max):##.##} {order}"; + if (bytes > max) return $"{decimal.Divide(bytes, max):##.##} {order}"; max /= scale; }