From 93bd0bc54fd5ce7a2803f2ebc7c834b1b815afda Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 6 Mar 2018 21:37:12 +0900 Subject: show message on find --- src/content/components/top-content/find.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/content/components/top-content/find.js') diff --git a/src/content/components/top-content/find.js b/src/content/components/top-content/find.js index bccf040..9967d36 100644 --- a/src/content/components/top-content/find.js +++ b/src/content/components/top-content/find.js @@ -38,6 +38,10 @@ export default class FindComponent { window.document, 'Pattern not found: ' + state.keyword); } + consoleFrames.postInfo( + window.document, + 'Pattern found: ' + state.keyword, + ); return this.store.dispatch(findActions.next(state.keyword, false)); } @@ -49,6 +53,10 @@ export default class FindComponent { window.document, 'Pattern not found: ' + state.keyword); } + consoleFrames.postInfo( + window.document, + 'Pattern found: ' + state.keyword, + ); return this.store.dispatch(findActions.prev(state.keyword, false)); } } -- cgit v1.2.3 From 4923cb20c77e7cc84d8ecdf1b12ee6c204701e71 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 6 Mar 2018 21:59:08 +0900 Subject: remove redundant checks --- src/content/components/top-content/find.js | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/content/components/top-content/find.js') diff --git a/src/content/components/top-content/find.js b/src/content/components/top-content/find.js index 9967d36..4d46d79 100644 --- a/src/content/components/top-content/find.js +++ b/src/content/components/top-content/find.js @@ -1,6 +1,5 @@ import * as findActions from 'content/actions/find'; import messages from 'shared/messages'; -import * as consoleFrames from '../../console-frames'; export default class FindComponent { constructor(win, store) { @@ -32,31 +31,11 @@ export default class FindComponent { next() { let state = this.store.getState().find; - - if (!state.found) { - return consoleFrames.postError( - window.document, - 'Pattern not found: ' + state.keyword); - } - consoleFrames.postInfo( - window.document, - 'Pattern found: ' + state.keyword, - ); return this.store.dispatch(findActions.next(state.keyword, false)); } prev() { let state = this.store.getState().find; - - if (!state.found) { - return consoleFrames.postError( - window.document, - 'Pattern not found: ' + state.keyword); - } - consoleFrames.postInfo( - window.document, - 'Pattern found: ' + state.keyword, - ); return this.store.dispatch(findActions.prev(state.keyword, false)); } } -- cgit v1.2.3