ログインするたびに統計が消えるバグを修正
This commit is contained in:
parent
36d8fd1d2c
commit
93831fd27b
1 changed files with 8 additions and 5 deletions
|
@ -27,6 +27,7 @@ const welcomeMessage = [
|
|||
];
|
||||
|
||||
const login = async (ctx: Context, user: Record<string, unknown>, host: string, token: string) => {
|
||||
const isNewcomer = !(await getUser(user.username as string, host));
|
||||
await upsertUser(user.username as string, host, token);
|
||||
|
||||
const u = await getUser(user.username as string, host);
|
||||
|
@ -36,11 +37,13 @@ const login = async (ctx: Context, user: Record<string, unknown>, host: string,
|
|||
return;
|
||||
}
|
||||
|
||||
if (isNewcomer) {
|
||||
await updateUser(u.username, u.host, {
|
||||
prevNotesCount: user.notesCount as number,
|
||||
prevFollowingCount: user.followingCount as number,
|
||||
prevFollowersCount: user.followersCount as number,
|
||||
});
|
||||
}
|
||||
|
||||
const misshaiToken = await updateUsersMisshaiToken(u);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue