Parent's children, optimalizations

This commit is contained in:
2022-04-18 21:27:04 +02:00
parent 8511ebac58
commit 570f695e60
14 changed files with 174 additions and 48 deletions

View File

@@ -16,7 +16,7 @@ namespace FileTime.Core.Services
public Tab()
{
CurrentLocation = _currentLocation.DistinctUntilChanged().Do(_ => {; }).Publish(null).RefCount();
CurrentLocation = _currentLocation.DistinctUntilChanged().Publish(null).RefCount();
CurrentItems =
Observable.Merge(
CurrentLocation
@@ -69,7 +69,7 @@ namespace FileTime.Core.Services
private IObservable<IAbsolutePath?> GetSelectedItemByLocation(IContainer? currentLocation)
{
//TODO:
return currentLocation?.Items?.Select(i => i.FirstOrDefault()) ?? Observable.Return((IAbsolutePath?)null);
return currentLocation?.Items?.Select(i => i?.FirstOrDefault()) ?? Observable.Return((IAbsolutePath?)null);
}
public void SetCurrentLocation(IContainer newLocation) => _currentLocation.OnNext(newLocation);