mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
code_review: PR #436
It's ok to call `Save()` multiple times after property of `ViewModels.Preference` changed immediately. If we delay the saving operation 3 seconds after the property changed event, we reduce the times calling `Save`, but the issue metioned in #436 may still exists.
This commit is contained in:
parent
9ee9f921f4
commit
9fe8ffcea9
2 changed files with 18 additions and 54 deletions
|
@ -75,12 +75,8 @@ namespace SourceGit
|
|||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
var pref = ViewModels.Preference.Instance;
|
||||
pref.PropertyChanged += (_1, _2) =>
|
||||
{
|
||||
#pragma warning disable CS4014
|
||||
pref.SaveAsync();
|
||||
#pragma warning restore CS4014
|
||||
};
|
||||
pref.PropertyChanged += (_1, _2) => pref.Save();
|
||||
|
||||
SetLocale(pref.Locale);
|
||||
SetTheme(pref.Theme, pref.ThemeOverrides);
|
||||
SetFonts(pref.DefaultFontFamily, pref.MonospaceFontFamily, pref.OnlyUseMonoFontInEditor);
|
||||
|
@ -527,9 +523,7 @@ namespace SourceGit
|
|||
|
||||
var pref = ViewModels.Preference.Instance;
|
||||
if (pref.ShouldCheck4UpdateOnStartup())
|
||||
{
|
||||
Check4Update();
|
||||
}
|
||||
}
|
||||
|
||||
private ViewModels.Launcher _launcher = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue