aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases/FollowSlaveUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-05-02 17:25:56 +0900
committerGitHub <noreply@github.com>2020-05-02 17:25:56 +0900
commit5df0537bcf65a341e79852b1b30379c73318529c (patch)
treeaee5efe52412855f620cb514a13a2c14373f27b7 /src/content/usecases/FollowSlaveUseCase.ts
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
parent75abd90ecb8201ad845b266f96220d8adfe19b2d (diff)
Merge pull request #749 from ueokande/qa-0.28
QA 0.28
Diffstat (limited to 'src/content/usecases/FollowSlaveUseCase.ts')
-rw-r--r--src/content/usecases/FollowSlaveUseCase.ts31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/content/usecases/FollowSlaveUseCase.ts b/src/content/usecases/FollowSlaveUseCase.ts
index fb805b9..971ecee 100644
--- a/src/content/usecases/FollowSlaveUseCase.ts
+++ b/src/content/usecases/FollowSlaveUseCase.ts
@@ -1,10 +1,10 @@
-import { injectable, inject } from 'tsyringe';
-import FollowSlaveRepository from '../repositories/FollowSlaveRepository';
-import FollowPresenter from '../presenters/FollowPresenter';
-import TabsClient from '../client/TabsClient';
-import FollowMasterClient from '../client/FollowMasterClient';
-import { LinkHint, InputHint } from '../presenters/Hint';
-import Key from '../../shared/settings/Key';
+import { injectable, inject } from "tsyringe";
+import FollowSlaveRepository from "../repositories/FollowSlaveRepository";
+import FollowPresenter from "../presenters/FollowPresenter";
+import TabsClient from "../client/TabsClient";
+import FollowMasterClient from "../client/FollowMasterClient";
+import { LinkHint, InputHint } from "../presenters/Hint";
+import Key from "../../shared/settings/Key";
interface Size {
width: number;
@@ -19,19 +19,18 @@ interface Point {
@injectable()
export default class FollowSlaveUseCase {
constructor(
- @inject('FollowPresenter')
+ @inject("FollowPresenter")
private presenter: FollowPresenter,
- @inject('TabsClient')
+ @inject("TabsClient")
private tabsClient: TabsClient,
- @inject('FollowMasterClient')
+ @inject("FollowMasterClient")
private followMasterClient: FollowMasterClient,
- @inject('FollowSlaveRepository')
- private followSlaveRepository: FollowSlaveRepository,
- ) {
- }
+ @inject("FollowSlaveRepository")
+ private followSlaveRepository: FollowSlaveRepository
+ ) {}
countTargets(viewSize: Size, framePosition: Point): void {
const count = this.presenter.getTargetCount(viewSize, framePosition);
@@ -65,11 +64,11 @@ export default class FollowSlaveUseCase {
const url = hint.getLink();
let openNewTab = newTab;
// Open link by background script in order to prevent a popup block
- if (hint.getLinkTarget() === '_blank') {
+ if (hint.getLinkTarget() === "_blank") {
openNewTab = true;
}
// eslint-disable-next-line no-script-url
- if (!url || url === '#' || url.toLowerCase().startsWith('javascript:')) {
+ if (!url || url === "#" || url.toLowerCase().startsWith("javascript:")) {
return;
}
await this.tabsClient.openUrl(url, openNewTab, background);