Fix filter stuck after RunOrOpen
This commit is contained in:
@@ -33,7 +33,7 @@ public abstract partial class AppStateBase : IAppState
|
|||||||
|
|
||||||
protected AppStateBase()
|
protected AppStateBase()
|
||||||
{
|
{
|
||||||
_rapidTravelText = new ("");
|
_rapidTravelText = new("");
|
||||||
RapidTravelText = _rapidTravelText.DistinctUntilChanged();
|
RapidTravelText = _rapidTravelText.DistinctUntilChanged();
|
||||||
RapidTravelTextDebounced = RapidTravelText
|
RapidTravelTextDebounced = RapidTravelText
|
||||||
.Debounce(v =>
|
.Debounce(v =>
|
||||||
@@ -79,7 +79,11 @@ public abstract partial class AppStateBase : IAppState
|
|||||||
|
|
||||||
public void SetSearchText(string? searchText) => _searchText.OnNext(searchText);
|
public void SetSearchText(string? searchText) => _searchText.OnNext(searchText);
|
||||||
|
|
||||||
public async Task SwitchViewModeAsync(ViewMode newViewMode) => await _viewMode.SetValue(newViewMode);
|
public async Task SwitchViewModeAsync(ViewMode newViewMode)
|
||||||
|
{
|
||||||
|
if (newViewMode != Models.Enums.ViewMode.RapidTravel) await SetRapidTravelTextAsync(null);
|
||||||
|
await _viewMode.SetValue(newViewMode);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task SetSelectedTabAsync(ITabViewModel tabToSelect) => await _selectedTab.SetValue(tabToSelect);
|
public async Task SetSelectedTabAsync(ITabViewModel tabToSelect) => await _selectedTab.SetValue(tabToSelect);
|
||||||
public async Task SetRapidTravelTextAsync(string? text) => await _rapidTravelText.SetValue(text);
|
public async Task SetRapidTravelTextAsync(string? text) => await _rapidTravelText.SetValue(text);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public partial class MainWindowViewModel : IMainWindowViewModel
|
|||||||
public bool Loading => false;
|
public bool Loading => false;
|
||||||
public IObservable<string?> MainFont => _fontService.MainFont.Select(x => x ?? "");
|
public IObservable<string?> MainFont => _fontService.MainFont.Select(x => x ?? "");
|
||||||
public DeclarativeProperty<string?> FatalError { get; } = new(null);
|
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 IGuiAppState AppState => _appState;
|
||||||
public DeclarativeProperty<string> Title { get; } = new(string.Empty);
|
public DeclarativeProperty<string> Title { get; } = new(string.Empty);
|
||||||
public Thickness IconStatusPanelMargin { get; private set; } = new(20, 10, 10, 10);
|
public Thickness IconStatusPanelMargin { get; private set; } = new(20, 10, 10, 10);
|
||||||
@@ -90,10 +90,10 @@ public partial class MainWindowViewModel : IMainWindowViewModel
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Title.SetValueSafe(title);
|
Title.SetValueSafe(title);
|
||||||
|
|
||||||
var localDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType != DriveType.Network);
|
var localDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType != DriveType.Network);
|
||||||
var networkDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType == DriveType.Network);
|
var networkDrives = _rootDriveInfoService.RootDriveInfos.Filtering(r => r.DriveType == DriveType.Network);
|
||||||
|
|
||||||
localDrives.For(_rootDriveInfosConsumer);
|
localDrives.For(_rootDriveInfosConsumer);
|
||||||
networkDrives.For(_rootDriveInfosConsumer);
|
networkDrives.For(_rootDriveInfosConsumer);
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ public partial class MainWindowViewModel : IMainWindowViewModel
|
|||||||
|
|
||||||
_modalService.AllModalClosed += (_, _) => FocusDefaultElement?.Invoke();
|
_modalService.AllModalClosed += (_, _) => FocusDefaultElement?.Invoke();
|
||||||
_instanceMessageHandler.ShowWindow += () => ShowWindow?.Invoke();
|
_instanceMessageHandler.ShowWindow += () => ShowWindow?.Invoke();
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
await Task.Delay(100);
|
await Task.Delay(100);
|
||||||
@@ -110,8 +110,18 @@ public partial class MainWindowViewModel : IMainWindowViewModel
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessKeyDown(KeyEventArgs e)
|
public void ProcessKeyDown(KeyEventArgs e) =>
|
||||||
=> _keyInputHandlerService.ProcessKeyDown(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)
|
public async Task OpenContainerByFullName(FullName fullName)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user