blob: 1339fdf3183f94e4e4762f7f37e283cec17bd853 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import SettingRepository from '../repositories/setting';
import TabPresenter from '../presenters/tab';
export default class LinkInteractor {
constructor() {
this.settingRepository = new SettingRepository();
this.tabPresenter = new TabPresenter();
}
openToTab(url, tabId) {
return this.tabPresenter.open(url, tabId);
}
async openNewTab(url, openerId, background) {
let settings = await this.settingRepository.get();
let { adjacenttab } = settings.properties;
if (adjacenttab) {
return this.tabPresenter.create(url, {
openerTabId: openerId, active: !background
});
}
return this.tabPresenter.create(url, {
openerTabId: openerId, active: !background
});
}
}
|