Remove useless dispatches

This commit is contained in:
Jorik Schellekens 2020-07-10 02:25:15 +01:00
parent 1983591cbf
commit ceff68476d

View file

@ -76,7 +76,6 @@ export default class RoomSearch extends React.PureComponent<IProps, IState> {
private clearInput = () => { private clearInput = () => {
if (!this.inputRef.current) return; if (!this.inputRef.current) return;
this.inputRef.current.value = ""; this.inputRef.current.value = "";
defaultDispatcher.dispatch({action: Action.StopRoomFilter});
this.onChange(); this.onChange();
}; };
@ -104,15 +103,9 @@ export default class RoomSearch extends React.PureComponent<IProps, IState> {
private onFocus = (ev: React.FocusEvent<HTMLInputElement>) => { private onFocus = (ev: React.FocusEvent<HTMLInputElement>) => {
this.setState({focused: true}); this.setState({focused: true});
ev.target.select(); ev.target.select();
if (ev.target.value === "") {
defaultDispatcher.dispatch({action: Action.StartRoomFilter});
}
}; };
private onBlur = (ev: React.FocusEvent<HTMLInputElement>) => { private onBlur = (ev: React.FocusEvent<HTMLInputElement>) => {
if (ev.target.value === "") {
defaultDispatcher.dispatch({action: Action.StopRoomFilter});
}
this.setState({focused: false}); this.setState({focused: false});
}; };