diff options
author | crupest <crupest@outlook.com> | 2020-06-04 00:18:50 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-04 00:18:50 +0800 |
commit | fccd6b4ca8ed7420f25f0c4298fde311bc1e09d0 (patch) | |
tree | 787cda66f8997ba842601a261a36b6de95398675 /Timeline/ClientApp/src/data/timeline.ts | |
parent | 92e50c4a3ea250dc18c76bc8c29d86d486e63772 (diff) | |
download | timeline-fccd6b4ca8ed7420f25f0c4298fde311bc1e09d0.tar.gz timeline-fccd6b4ca8ed7420f25f0c4298fde311bc1e09d0.tar.bz2 timeline-fccd6b4ca8ed7420f25f0c4298fde311bc1e09d0.zip |
refactor(front): Make codes lint-clean!
Diffstat (limited to 'Timeline/ClientApp/src/data/timeline.ts')
-rw-r--r-- | Timeline/ClientApp/src/data/timeline.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Timeline/ClientApp/src/data/timeline.ts b/Timeline/ClientApp/src/data/timeline.ts index bc5e1658..66d9e57a 100644 --- a/Timeline/ClientApp/src/data/timeline.ts +++ b/Timeline/ClientApp/src/data/timeline.ts @@ -4,6 +4,7 @@ import XRegExp from 'xregexp'; import { base64 } from './base64';
import { apiBaseUrl } from '../config';
import { User, UserAuthInfo, getCurrentUser, UserWithToken } from './user';
+import { UiLogicError } from '../common';
export const kTimelineVisibilities = ['Public', 'Register', 'Private'] as const;
@@ -159,7 +160,7 @@ export class TimelineServiceTemplate< private checkUser(): UserWithToken {
const user = getCurrentUser();
if (user == null) {
- throw new Error('You must login to perform the operation.');
+ throw new UiLogicError('You must login to perform the operation.');
}
return user;
}
@@ -204,7 +205,7 @@ export class TimelineServiceTemplate< RawCreatePostRequestContent
>((resolve) => {
if (request.content.type === 'image') {
- base64(request.content.data).then((d) =>
+ void base64(request.content.data).then((d) =>
resolve({
...request.content,
data: d,
|