diff options
author | crupest <crupest@outlook.com> | 2020-08-05 23:29:14 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-05 23:29:14 +0800 |
commit | be9eb313ccad0832cb37e1c63e03608c47c2d171 (patch) | |
tree | e989d42596f60b5b2157341edb5ec7ea648d1881 /Timeline/ClientApp/src/app/data/user.ts | |
parent | 0791682e1f333adb5c79b979e3e8c5c50bb5f85a (diff) | |
download | timeline-be9eb313ccad0832cb37e1c63e03608c47c2d171.tar.gz timeline-be9eb313ccad0832cb37e1c63e03608c47c2d171.tar.bz2 timeline-be9eb313ccad0832cb37e1c63e03608c47c2d171.zip |
Refactor a lot.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/user.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/user.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Timeline/ClientApp/src/app/data/user.ts b/Timeline/ClientApp/src/app/data/user.ts index 7d522b26..65b53a6f 100644 --- a/Timeline/ClientApp/src/app/data/user.ts +++ b/Timeline/ClientApp/src/app/data/user.ts @@ -230,11 +230,11 @@ export class UserNotExistError extends Error {} export class UserInfoService {
private _avatarSubscriptionHub = new SubscriptionHub<string, Blob>({
- setup: (key, next) => {
+ setup: (key, line) => {
void getHttpUserClient()
.getAvatar(key)
.then((res) => {
- next(res.data);
+ line.next(res.data);
});
},
});
@@ -248,7 +248,7 @@ export class UserInfoService { async setAvatar(username: string, blob: Blob): Promise<void> {
const user = checkLogin();
await getHttpUserClient().putAvatar(username, blob, user.token);
- this._avatarSubscriptionHub.update(username, blob);
+ this._avatarSubscriptionHub.getLine(username)?.next(blob);
}
get avatarHub(): ISubscriptionHub<string, Blob> {
|