aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-04-15 13:19:32 +0000
committerGitHub <noreply@github.com>2021-04-15 13:19:32 +0000
commit6a554b4d4e9659331df633bc04eae31557572722 (patch)
tree350f0540edf2d6cbfaadccbc115659a433aee4fe /src/content
parent67004642ee7430e3a3bca72619ff57a47a7c4495 (diff)
parent09ec6d49435d855f0b2e51c71ff7cedb059ecb86 (diff)
Merge pull request #1104 from ueokande/mark-error-message
Show an error on mark not set
Diffstat (limited to 'src/content')
-rw-r--r--src/content/usecases/MarkUseCase.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content/usecases/MarkUseCase.ts b/src/content/usecases/MarkUseCase.ts
index 002fdee..f5f512c 100644
--- a/src/content/usecases/MarkUseCase.ts
+++ b/src/content/usecases/MarkUseCase.ts
@@ -18,7 +18,7 @@ export default class MarkUseCase {
async set(key: string): Promise<void> {
const pos = this.scrollPresenter.getScroll();
if (this.globalKey(key)) {
- this.client.setGloablMark(key, pos);
+ await this.client.setGloablMark(key, pos);
await this.consoleClient.info(`Set global mark to '${key}'`);
} else {
this.repository.set(key, pos);
@@ -32,7 +32,8 @@ export default class MarkUseCase {
} else {
const pos = this.repository.get(key);
if (!pos) {
- throw new Error("Mark is not set");
+ await this.consoleClient.error("Mark is not set");
+ return;
}
this.scroll(pos.x, pos.y);
}