Fix rapid travel mode, universal commands

This commit is contained in:
2022-06-09 17:07:29 +02:00
parent 6e9f6f371f
commit 9d48caaa58
3 changed files with 19 additions and 7 deletions

View File

@@ -75,7 +75,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
{
var pathInput = new TextInputElement("Path");
await _userCommunicationService.ReadInputs(pathInput);
//TODO: message on empty result and on null pathInput.Value
var resolvedPath = await _timelessContentProvider.GetItemByNativePathAsync(new NativePath(pathInput.Value));
if (resolvedPath is IContainer container)
@@ -146,6 +146,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
if (_currentSelectedItem is not IContainerViewModel containerViewModel || containerViewModel.Container is null)
return Task.CompletedTask;
_appState.RapidTravelText = "";
_selectedTab?.Tab?.SetCurrentLocation(containerViewModel.Container);
return Task.CompletedTask;
}
@@ -153,7 +154,12 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
private async Task GoUp()
{
if (_currentLocation?.Parent is not AbsolutePath parentPath ||
await parentPath.ResolveAsyncSafe() is not IContainer newContainer) return;
await parentPath.ResolveAsyncSafe() is not IContainer newContainer)
{
return;
}
_appState.RapidTravelText = "";
_selectedTab?.Tab?.SetCurrentLocation(newContainer);
}