diff --git a/Foxnouns.Backend/Controllers/MembersController.cs b/Foxnouns.Backend/Controllers/MembersController.cs index bc35f62..635dab9 100644 --- a/Foxnouns.Backend/Controllers/MembersController.cs +++ b/Foxnouns.Backend/Controllers/MembersController.cs @@ -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(); diff --git a/Foxnouns.Backend/Controllers/UsersController.cs b/Foxnouns.Backend/Controllers/UsersController.cs index 787ff66..48a42aa 100644 --- a/Foxnouns.Backend/Controllers/UsersController.cs +++ b/Foxnouns.Backend/Controllers/UsersController.cs @@ -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);