Fixed a bug with keyboard shortcuts crushing the app. (#607)

This commit is contained in:
Aleksandar Pesic authored and Felix Seidl committed 2019-12-02 23:46:19 +01:00
1 parent 122dfccc00
commit 8593b5ac5f
1 file changed
+8 -5
@@ -541,16 +541,19 @@ namespace FluentTerminal.App.ViewModels
}
case nameof(Command.Search):
{
ShowSearchPanel = !ShowSearchPanel;
if (ShowSearchPanel)
await ApplicationView.ExecuteOnUiThreadAsync(() =>
{
SearchStarted?.Invoke(this, EventArgs.Empty);
}
ShowSearchPanel = !ShowSearchPanel;
if (ShowSearchPanel)
{
SearchStarted?.Invoke(this, EventArgs.Empty);
}
});
break;
}
default:
{
_keyboardCommandService.SendCommand(e);
await ApplicationView.ExecuteOnUiThreadAsync(() => _keyboardCommandService.SendCommand(e));
break;
}
}