From a8320d598574d699ec67387ace1e370fee46bb39 Mon Sep 17 00:00:00 2001 From: rampaa Date: Sun, 8 Dec 2024 15:39:39 +0300 Subject: [PATCH] Minor --- JL.Core/Dicts/DictUpdater.cs | 1 - JL.Windows/GUI/MainWindow.xaml.cs | 2 +- JL.Windows/GUI/PreferencesWindow.xaml.cs | 15 +++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/JL.Core/Dicts/DictUpdater.cs b/JL.Core/Dicts/DictUpdater.cs index 6aca0e4b..0ea8a0ca 100644 --- a/JL.Core/Dicts/DictUpdater.cs +++ b/JL.Core/Dicts/DictUpdater.cs @@ -71,7 +71,6 @@ internal static async Task DownloadDict(string dictPath, Uri dictDownloadU catch (Exception ex) { Utils.Frontend.ShowOkDialog($"Unexpected error while downloading {dictName}.", "Info"); - Utils.Logger.Error(ex, "Unexpected error while downloading {DictName}", dictName); } diff --git a/JL.Windows/GUI/MainWindow.xaml.cs b/JL.Windows/GUI/MainWindow.xaml.cs index 5a9dd075..b9fbd126 100644 --- a/JL.Windows/GUI/MainWindow.xaml.cs +++ b/JL.Windows/GUI/MainWindow.xaml.cs @@ -174,7 +174,7 @@ private bool CopyText(string text) { if (configManager.MergeSequentialTextsWhenTheyMatch) { - s_lastTextCopyTime = new(Stopwatch.GetTimestamp()); + s_lastTextCopyTime = new DateTime(Stopwatch.GetTimestamp()); } return false; diff --git a/JL.Windows/GUI/PreferencesWindow.xaml.cs b/JL.Windows/GUI/PreferencesWindow.xaml.cs index b3c02fba..db0fd328 100644 --- a/JL.Windows/GUI/PreferencesWindow.xaml.cs +++ b/JL.Windows/GUI/PreferencesWindow.xaml.cs @@ -644,14 +644,17 @@ private void ProfileComboBox_SelectionChanged(object sender, SelectionChangedEve ProfileDBUtils.UpdateCurrentProfile(connection); Stats.ProfileLifetimeStats = StatsDBUtils.GetStatsFromDB(connection, ProfileUtils.CurrentProfileId)!; StatsDBUtils.UpdateProfileLifetimeStats(connection); + } - ConfigManager configManager = ConfigManager.Instance; - Application.Current.Dispatcher.Invoke(() => + ConfigManager configManager = ConfigManager.Instance; + Application.Current.Dispatcher.Invoke(() => + { + using (SqliteConnection preferencesConnection = ConfigDBManager.CreateReadWriteDBConnection()) { - configManager.ApplyPreferences(connection); - configManager.LoadPreferenceWindow(this); - }); - } + configManager.ApplyPreferences(preferencesConnection); + } + configManager.LoadPreferenceWindow(this); + }); RegexReplacerUtils.PopulateRegexReplacements(); }