Extract focus_search dispatch action into enum (#12721)
* Extract `focus_search` dispatch action into enum Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * copypasta Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b0d2010247
commit
6b90fe20ab
@@ -458,9 +458,7 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||
handled = true;
|
||||
break;
|
||||
case KeyBindingAction.SearchInRoom:
|
||||
dis.dispatch({
|
||||
action: "focus_search",
|
||||
});
|
||||
dis.fire(Action.FocusMessageSearch);
|
||||
handled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1196,7 +1196,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
);
|
||||
}
|
||||
break;
|
||||
case "focus_search":
|
||||
case Action.FocusMessageSearch:
|
||||
this.onSearchClick();
|
||||
break;
|
||||
|
||||
|
||||
@@ -388,4 +388,9 @@ export enum Action {
|
||||
* Opens right panel with 3pid invite information
|
||||
*/
|
||||
View3pidInvite = "view_3pid_invite",
|
||||
|
||||
/**
|
||||
* Opens right panel room summary and focuses the search input
|
||||
*/
|
||||
FocusMessageSearch = "focus_search",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user