refactor: merge ViewModels.PopupHost into ViewModels.LauncherPage

This commit is contained in:
leo 2025-01-08 21:36:49 +08:00
parent 0e34a77add
commit f06b1d5d51
No known key found for this signature in database
14 changed files with 342 additions and 344 deletions

View file

@ -36,7 +36,6 @@ namespace SourceGit.ViewModels
{
if (SetProperty(ref _activePage, value))
{
PopupHost.Active = value;
UpdateTitle();
if (!_ignoreIndexChange && value is { Data: Repository repo })
@ -295,7 +294,6 @@ namespace SourceGit.ViewModels
FullPath = node.Id,
GitDir = gitDir,
};
repo.Open();
if (page == null)
@ -318,6 +316,8 @@ namespace SourceGit.ViewModels
page.Data = repo;
}
repo.SetOwnerPage(page);
if (page != _activePage)
ActivePage = page;
else
@ -475,7 +475,7 @@ namespace SourceGit.ViewModels
{
foreach (var one in Pages)
{
if (one.IsInProgress())
if (!one.CanCreatePopup() || one.Data is Repository { IsAutoFetching: true })
{
App.RaiseException(null, "You have unfinished task(s) in opened pages. Please wait!!!");
return;