refactor: delay starting background tasks

* start background task only it is needed
* solve the problem that we can not use `ViewModels.Preference.Instance` until resource ready
* remove avatar sever settings
This commit is contained in:
leo 2024-08-18 23:09:55 +08:00
parent e7921db339
commit 7fe1df20cc
No known key found for this signature in database
13 changed files with 178 additions and 190 deletions

View file

@ -141,7 +141,7 @@ namespace SourceGit.ViewModels
var last = Pages[0];
if (last.Data is Repository repo)
{
Commands.AutoFetch.RemoveRepository(repo.FullPath);
Models.AutoFetchManager.Instance.RemoveRepository(repo.FullPath);
repo.Close();
last.Node = new RepositoryNode() { Id = Guid.NewGuid().ToString() };
@ -245,7 +245,7 @@ namespace SourceGit.ViewModels
};
repo.Open();
Commands.AutoFetch.AddRepository(repo.FullPath);
Models.AutoFetchManager.Instance.AddRepository(repo.FullPath);
if (page == null)
{
@ -371,7 +371,7 @@ namespace SourceGit.ViewModels
{
if (page.Data is Repository repo)
{
Commands.AutoFetch.RemoveRepository(repo.FullPath);
Models.AutoFetchManager.Instance.RemoveRepository(repo.FullPath);
repo.Close();
}