Refresh command
This commit is contained in:
@@ -54,10 +54,21 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
|
||||
new TypeUserCommandHandler<MoveCursorUpCommand>(MoveCursorUp),
|
||||
new TypeUserCommandHandler<OpenContainerCommand>(OpenContainer),
|
||||
new TypeUserCommandHandler<OpenSelectedCommand>(OpenSelected),
|
||||
new TypeUserCommandHandler<RefreshCommand>(Refresh),
|
||||
new TypeUserCommandHandler<SwitchToTabCommand>(SwitchToTab),
|
||||
});
|
||||
}
|
||||
|
||||
private async Task Refresh(RefreshCommand command)
|
||||
{
|
||||
if (_currentLocation?.FullName is null) return;
|
||||
var refreshedItem = await _timelessContentProvider.GetItemByFullNameAsync(_currentLocation.FullName, PointInTime.Present);
|
||||
|
||||
if (refreshedItem is not IContainer refreshedContainer) return;
|
||||
|
||||
_selectedTab?.Tab?.ForceSetCurrentLocation(refreshedContainer);
|
||||
}
|
||||
|
||||
private async Task OpenContainer(OpenContainerCommand command)
|
||||
{
|
||||
var resolvedPath = await command.Path.ResolveAsync();
|
||||
|
||||
@@ -24,6 +24,8 @@ public class DefaultIdentifiableCommandHandlerRegister : IStartupHandler
|
||||
AddUserCommand(PasteCommand.Merge);
|
||||
AddUserCommand(PasteCommand.Overwrite);
|
||||
AddUserCommand(PasteCommand.Skip);
|
||||
AddUserCommand(RefreshCommand.Instance);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToLastTab);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab1);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab2);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab3);
|
||||
@@ -32,7 +34,6 @@ public class DefaultIdentifiableCommandHandlerRegister : IStartupHandler
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab6);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab7);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToTab8);
|
||||
AddUserCommand(SwitchToTabCommand.SwitchToLastTab);
|
||||
}
|
||||
|
||||
private void AddUserCommand(IIdentifiableUserCommand command)
|
||||
|
||||
Reference in New Issue
Block a user