fix(backend): update User.LastActive in more places

This commit is contained in:
sam 2025-03-05 15:40:13 +01:00
parent 790b39f730
commit 200e648772
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
2 changed files with 10 additions and 0 deletions

View file

@ -121,6 +121,9 @@ public class MembersController(
CurrentUser!.Id
);
CurrentUser.LastActive = clock.GetCurrentInstant();
db.Update(CurrentUser);
try
{
await db.SaveChangesAsync(ct);
@ -238,6 +241,9 @@ public class MembersController(
MemberAvatarUpdateJob.Enqueue(new AvatarUpdatePayload(member.Id, req.Avatar));
}
CurrentUser.LastActive = clock.GetCurrentInstant();
db.Update(CurrentUser);
try
{
await db.SaveChangesAsync();

View file

@ -178,6 +178,8 @@ public class UsersController(
UserAvatarUpdateJob.Enqueue(new AvatarUpdatePayload(CurrentUser!.Id, req.Avatar));
}
user.LastActive = clock.GetCurrentInstant();
try
{
await db.SaveChangesAsync(ct);
@ -253,6 +255,7 @@ public class UsersController(
}
user.CustomPreferences = preferences;
user.LastActive = clock.GetCurrentInstant();
await db.SaveChangesAsync(ct);
return Ok(user.CustomPreferences);
@ -280,6 +283,7 @@ public class UsersController(
if (req.HasProperty(nameof(req.DarkMode)))
user.Settings.DarkMode = req.DarkMode;
user.LastActive = clock.GetCurrentInstant();
db.Update(user);
await db.SaveChangesAsync(ct);