mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
Avoid duplication of Repository tab
This commit is contained in:
parent
01625ada1a
commit
0a50631c06
1 changed files with 13 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
using System.Linq;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
|
@ -132,9 +132,18 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void AddNewTab()
|
||||
{
|
||||
var page = new LauncherPage();
|
||||
Pages.Add(page);
|
||||
ActivePage = page;
|
||||
var existingRepositoriesPAge =
|
||||
Pages.FirstOrDefault(p => string.IsNullOrEmpty(p.Node.Name));
|
||||
if (existingRepositoriesPAge != null)
|
||||
{
|
||||
ActivePage = existingRepositoriesPAge;
|
||||
}
|
||||
else
|
||||
{
|
||||
var page = new LauncherPage();
|
||||
Pages.Add(page);
|
||||
ActivePage = page;
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveTab(LauncherPage from, LauncherPage to)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue