Skip to content

Commit 9527994

Browse files
committed
fix: Initialize Repository should apply the bookmark setting from Open Repository popup
Signed-off-by: leo <longshuang@msn.cn>
1 parent a5317dd commit 9527994

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/ViewModels/Init.cs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ public string Reason
1616
private set;
1717
}
1818

19-
public Init(string pageId, string path, RepositoryNode parent, string reason)
19+
public Init(string pageId, string path, RepositoryNode parent, int bookmark, string reason)
2020
{
2121
_pageId = pageId;
2222
_targetPath = path;
2323
_parentNode = parent;
24+
_bookmark = bookmark;
2425

2526
Reason = string.IsNullOrEmpty(reason) ? "unknown error" : reason;
2627
Reason = Reason.Trim();
@@ -42,6 +43,7 @@ public override async Task<bool> Sure()
4243
if (succ)
4344
{
4445
var node = Preferences.Instance.FindOrAddNodeByRepositoryPath(_targetPath, _parentNode, true);
46+
node.Bookmark = _bookmark;
4547
await node.UpdateStatusAsync(false, null);
4648

4749
Welcome.Instance.Refresh();
@@ -52,5 +54,6 @@ public override async Task<bool> Sure()
5254
private readonly string _pageId = null;
5355
private string _targetPath = null;
5456
private readonly RepositoryNode _parentNode = null;
57+
private readonly int _bookmark = 0;
5558
}
5659
}

‎src/ViewModels/OpenLocalRepository.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public override async Task<bool> Sure()
7878
{
7979
if (page.Node.Id.Equals(_pageId, StringComparison.Ordinal))
8080
{
81-
page.Popup = new Init(page.Node.Id, _repoPath, parent, test.StdErr);
81+
page.Popup = new Init(page.Node.Id, _repoPath, parent, _bookmark, test.StdErr);
8282
break;
8383
}
8484
}

0 commit comments

Comments
 (0)