mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
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:
parent
e7921db339
commit
7fe1df20cc
13 changed files with 178 additions and 190 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue