Now uses correct username for lock filtering.

WIP: needs an error popup if user is misconfigured
This commit is contained in:
Mat 2024-09-23 17:12:51 +02:00
parent fca1957501
commit 6e35ac9eb0

View file

@ -45,7 +45,13 @@ namespace SourceGit.ViewModels
{
get
{
return ShowOnlyMyLocks ? Locks.Where(@lock => @lock.User == "Mat") : Locks;
if (string.IsNullOrEmpty(_userName))
{
//todo: add an error popup
return Locks;
}
return ShowOnlyMyLocks ? Locks.Where(@lock => @lock.User == _userName) : Locks;
}
}
@ -54,6 +60,7 @@ namespace SourceGit.ViewModels
_repo = repo;
_remote = remote;
Locks = new AvaloniaList<Models.LFSLock>();
new Commands.Config(repo).ListAll().TryGetValue("user.name", out _userName);
Task.Run(() =>
{
@ -94,5 +101,6 @@ namespace SourceGit.ViewModels
private bool _isLoading = true;
private bool _isEmpty = false;
private bool _showOnlyMyLocks = false;
private string _userName;
}
}