aboutsummaryrefslogtreecommitdiff
path: root/src/reducers/background.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-14 21:40:28 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-14 21:47:53 +0900
commit6127fdc285bc430b48259bd6e90b69623b4e76cc (patch)
tree3208d48375a95a7627ea763b3619a161b732feb4 /src/reducers/background.js
parentc42ac8fac48f9d56b54af4818917082fda9af21e (diff)
use input as store/reducer
Diffstat (limited to 'src/reducers/background.js')
-rw-r--r--src/reducers/background.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/reducers/background.js b/src/reducers/background.js
index 7a279c9..ba934fd 100644
--- a/src/reducers/background.js
+++ b/src/reducers/background.js
@@ -2,7 +2,7 @@ import * as tabs from '../background/tabs';
import * as consoleActions from '../actions/console';
import actions from '../actions';
-const doCompletion = (command, keywords, sender) => {
+const doCompletion = (command, keywords, tabId) => {
if (command === 'buffer') {
return tabs.getCompletions(keywords).then((tabs) => {
let items = tabs.map((tab) => {
@@ -18,18 +18,18 @@ const doCompletion = (command, keywords, sender) => {
items: items
};
return browser.tabs.sendMessage(
- sender,
+ tabId,
consoleActions.setCompletions([completions]));
});
}
return Promise.resolve();
};
-export default function reducer(state, action = {}, sender) {
+export default function reducer(state, action = {}, sendToTab) {
// TODO hide sender object
switch (action.type) {
case actions.BACKGROUND_REQUEST_COMPLETIONS:
- return doCompletion(action.command, action.keywords, sender.tab.id);
+ return doCompletion(action.command, action.keywords, sendToTab.id);
default:
return Promise.resolve();
}