diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-29 13:34:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-29 13:34:10 +0900 |
commit | 8ea004f629021a0fb5fcbce9398f2cf2f952938a (patch) | |
tree | d35d37b1688aaf6a22389a6b761e2be2f98f85c7 /src/background/usecases/operation.js | |
parent | 85e9b9da3714c0fa2998b0fab8f2a01c49d84d5a (diff) | |
parent | b3672f0ffd82148716b38d133f35a5f9d2706ba8 (diff) |
Merge pull request #442 from ueokande/search-on-paste
Buffer flags
Diffstat (limited to 'src/background/usecases/operation.js')
-rw-r--r-- | src/background/usecases/operation.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/background/usecases/operation.js b/src/background/usecases/operation.js index 7bf93e4..74ea830 100644 --- a/src/background/usecases/operation.js +++ b/src/background/usecases/operation.js @@ -1,10 +1,6 @@ -import MemoryStorage from '../infrastructures/memory-storage'; import TabPresenter from '../presenters/tab'; import ConsolePresenter from '../presenters/console'; -const CURRENT_SELECTED_KEY = 'tabs.current.selected'; -const LAST_SELECTED_KEY = 'tabs.last.selected'; - const ZOOM_SETTINGS = [ 0.33, 0.50, 0.66, 0.75, 0.80, 0.90, 1.00, 1.10, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00 @@ -13,11 +9,7 @@ const ZOOM_SETTINGS = [ export default class OperationInteractor { constructor() { this.tabPresenter = new TabPresenter(); - this.tabPresenter.onSelected(info => this.onTabSelected(info.tabId)); - this.consolePresenter = new ConsolePresenter(); - - this.cache = new MemoryStorage(); } async close(force) { @@ -69,7 +61,7 @@ export default class OperationInteractor { } async selectPrevSelected() { - let tabId = await this.cache.get(LAST_SELECTED_KEY); + let tabId = await this.tabPresenter.getLastSelectedId(); if (tabId === null || typeof tabId === 'undefined') { return; } @@ -180,13 +172,5 @@ export default class OperationInteractor { let tab = await this.tabPresenter.getCurrent(); return this.consolePresenter.hide(tab.id); } - - onTabSelected(tabId) { - let lastId = this.cache.get(CURRENT_SELECTED_KEY); - if (lastId) { - this.cache.set(LAST_SELECTED_KEY, lastId); - } - this.cache.set(CURRENT_SELECTED_KEY, tabId); - } } |