Fix filter stuck after RunOrOpen

This commit is contained in:
2023-10-31 14:44:17 +01:00
parent 17466de219
commit 63a450fc5f
2 changed files with 22 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ public partial class MainWindowViewModel : IMainWindowViewModel
public bool Loading => false;
public IObservable<string?> MainFont => _fontService.MainFont.Select(x => x ?? "");
public DeclarativeProperty<string?> FatalError { get; } = new(null);
public IReadOnlyList<WindowTransparencyLevel> TransparencyLevelHint { get; } = new[] {WindowTransparencyLevel.Blur};
public IReadOnlyList<WindowTransparencyLevel> TransparencyLevelHint { get; } = new[] { WindowTransparencyLevel.Blur };
public IGuiAppState AppState => _appState;
public DeclarativeProperty<string> Title { get; } = new(string.Empty);
public Thickness IconStatusPanelMargin { get; private set; } = new(20, 10, 10, 10);
@@ -90,10 +90,10 @@ public partial class MainWindowViewModel : IMainWindowViewModel
#endif
Title.SetValueSafe(title);
var localDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType != DriveType.Network);
var networkDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType == DriveType.Network);
localDrives.For(_rootDriveInfosConsumer);
networkDrives.For(_rootDriveInfosConsumer);
@@ -102,7 +102,7 @@ public partial class MainWindowViewModel : IMainWindowViewModel
_modalService.AllModalClosed += (_, _) => FocusDefaultElement?.Invoke();
_instanceMessageHandler.ShowWindow += () => ShowWindow?.Invoke();
Task.Run(async () =>
{
await Task.Delay(100);
@@ -110,8 +110,18 @@ public partial class MainWindowViewModel : IMainWindowViewModel
});
}
public void ProcessKeyDown(KeyEventArgs e)
=> _keyInputHandlerService.ProcessKeyDown(e);
public void ProcessKeyDown(KeyEventArgs e) =>
Task.Run(async () =>
{
try
{
await _keyInputHandlerService.ProcessKeyDown(e);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error while processing key down event");
}
});
public async Task OpenContainerByFullName(FullName fullName)
{