diff options
Diffstat (limited to 'src/reducers/background.js')
-rw-r--r-- | src/reducers/background.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/reducers/background.js b/src/reducers/background.js deleted file mode 100644 index ba934fd..0000000 --- a/src/reducers/background.js +++ /dev/null @@ -1,36 +0,0 @@ -import * as tabs from '../background/tabs'; -import * as consoleActions from '../actions/console'; -import actions from '../actions'; - -const doCompletion = (command, keywords, tabId) => { - if (command === 'buffer') { - return tabs.getCompletions(keywords).then((tabs) => { - let items = tabs.map((tab) => { - return { - caption: tab.title, - content: tab.title, - url: tab.url, - icon: tab.favIconUrl - } - }); - let completions = { - name: "Buffers", - items: items - }; - return browser.tabs.sendMessage( - tabId, - consoleActions.setCompletions([completions])); - }); - } - return Promise.resolve(); -}; - -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, sendToTab.id); - default: - return Promise.resolve(); - } -} |