Find as a controller

This commit is contained in:
Shin'ya Ueoka 2019-05-11 13:55:25 +09:00
parent ad1f3c07fb
commit fcd15f4f09
9 changed files with 78 additions and 75 deletions

View file

@ -53,7 +53,7 @@ const enterCommand = async(
return hideCommand();
};
const enterFind = (text: string): actions.ConsoleAction => {
const enterFind = (text?: string): actions.ConsoleAction => {
window.top.postMessage(JSON.stringify({
type: messages.CONSOLE_ENTER_FIND,
text,

View file

@ -38,7 +38,8 @@ class Console extends React.Component<Props> {
if (this.props.mode === 'command') {
return this.props.dispatch(consoleActions.enterCommand(value));
} else if (this.props.mode === 'find') {
return this.props.dispatch(consoleActions.enterFind(value));
return this.props.dispatch(consoleActions.enterFind(
value === '' ? undefined : value));
}
}