cache when computing note count etc.

This commit is contained in:
Johann150 2023-05-27 20:34:28 +02:00
parent 5408929c2a
commit d55f8742b8
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -182,6 +182,13 @@ export default define(meta, paramDef, async (ps, me) => {
result.followingCount = result.localFollowingCount + result.remoteFollowingCount;
result.followersCount = result.localFollowersCount + result.remoteFollowersCount;
// store the updated counts in the user table to potentially fix the cache
Users.update(user.id, {
followersCount: result.followersCount,
followingCount: result.followingCount,
notesCount: result.notesCount,
});
}
return result;