aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/MarkUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
commite1dac618a8b8929f601c7ec8aca3842c5ebf9d03 (patch)
tree6a914a8243c8c02e7752a83667a54d3fa832955c /src/background/usecases/MarkUseCase.ts
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
Use plugin:prettier/recommended
Diffstat (limited to 'src/background/usecases/MarkUseCase.ts')
-rw-r--r--src/background/usecases/MarkUseCase.ts26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/background/usecases/MarkUseCase.ts b/src/background/usecases/MarkUseCase.ts
index 2c0bc13..9da9a21 100644
--- a/src/background/usecases/MarkUseCase.ts
+++ b/src/background/usecases/MarkUseCase.ts
@@ -1,18 +1,17 @@
-import { inject, injectable } from 'tsyringe';
-import TabPresenter from '../presenters/TabPresenter';
-import MarkRepository from '../repositories/MarkRepository';
-import ConsoleClient from '../infrastructures/ConsoleClient';
-import ContentMessageClient from '../infrastructures/ContentMessageClient';
+import { inject, injectable } from "tsyringe";
+import TabPresenter from "../presenters/TabPresenter";
+import MarkRepository from "../repositories/MarkRepository";
+import ConsoleClient from "../infrastructures/ConsoleClient";
+import ContentMessageClient from "../infrastructures/ContentMessageClient";
@injectable()
export default class MarkUseCase {
constructor(
- @inject('TabPresenter') private tabPresenter: TabPresenter,
+ @inject("TabPresenter") private tabPresenter: TabPresenter,
private markRepository: MarkRepository,
private consoleClient: ConsoleClient,
- private contentMessageClient: ContentMessageClient,
- ) {
- }
+ private contentMessageClient: ContentMessageClient
+ ) {}
async setGlobal(key: string, x: number, y: number): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
@@ -26,7 +25,9 @@ export default class MarkUseCase {
const mark = await this.markRepository.getMark(key);
if (!mark) {
return this.consoleClient.showError(
- current.id as number, 'Mark is not set');
+ current.id as number,
+ "Mark is not set"
+ );
}
try {
await this.contentMessageClient.scrollTo(mark.tabId, mark.x, mark.y);
@@ -34,7 +35,10 @@ export default class MarkUseCase {
} catch (e) {
const tab = await this.tabPresenter.create(mark.url);
return this.markRepository.setMark(key, {
- tabId: tab.id as number, url: mark.url, x: mark.x, y: mark.y,
+ tabId: tab.id as number,
+ url: mark.url,
+ x: mark.x,
+ y: mark.y,
});
}
}