TabPresenter

jh-changes
Shin'ya Ueoka 6 years ago
parent a2345f55d6
commit b130fd5268
  1. 2
      src/background/presenters/tab.js
  2. 6
      src/background/usecases/version.js

@ -1,4 +1,4 @@
export default class TabRepository { export default class TabPresenter {
create(url) { create(url) {
browser.tabs.create({ url, }); browser.tabs.create({ url, });
} }

@ -1,12 +1,12 @@
import manifest from '../../../manifest.json'; import manifest from '../../../manifest.json';
import VersionRepository from '../repositories/version'; import VersionRepository from '../repositories/version';
import TabRepository from '../repositories/tab'; import TabPresenter from '../presenters/tab';
import Notifier from '../infrastructures/notifier'; import Notifier from '../infrastructures/notifier';
export default class VersionInteractor { export default class VersionInteractor {
constructor() { constructor() {
this.versionRepository = new VersionRepository(); this.versionRepository = new VersionRepository();
this.tabRepository = new TabRepository(); this.tabPresenter = new TabPresenter();
this.notifier = new Notifier(); this.notifier = new Notifier();
} }
@ -19,7 +19,7 @@ export default class VersionInteractor {
let message = 'Click here to see release notes'; let message = 'Click here to see release notes';
this.notifier.notify(title, message, () => { this.notifier.notify(title, message, () => {
let url = this.releaseNoteUrl(manifest.version); let url = this.releaseNoteUrl(manifest.version);
this.tabRepository.create(url); this.tabPresenter.create(url);
}); });
this.versionRepository.update(manifest.version); this.versionRepository.update(manifest.version);
} }