aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/data/timeline.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-04 00:18:50 +0800
committercrupest <crupest@outlook.com>2020-06-04 00:18:50 +0800
commit3aa87cc26fd58836b82c067b58a47e08e30a7784 (patch)
treeba9cf1918d210896ab10bed484a8ddf7c7935e0c /Timeline/ClientApp/src/data/timeline.ts
parent1e90a93049cd57098608de72f02bfaabfadd32b6 (diff)
downloadtimeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.tar.gz
timeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.tar.bz2
timeline-3aa87cc26fd58836b82c067b58a47e08e30a7784.zip
refactor(front): Make codes lint-clean!
Diffstat (limited to 'Timeline/ClientApp/src/data/timeline.ts')
-rw-r--r--Timeline/ClientApp/src/data/timeline.ts5
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,