From 741f6c07d290daae15fe95b9ef17e58bb0bd3647 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 4 Apr 2026 12:28:16 -0400 Subject: [PATCH] fix: Current user last active at (#11957) * fix: Last active timestamp should always read as now for current user * Shorten language on members table --- app/models/User.ts | 18 +++++++++++++++++- .../Settings/components/MembersTable.tsx | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/models/User.ts b/app/models/User.ts index 4a11296dba..63fbc77e3a 100644 --- a/app/models/User.ts +++ b/app/models/User.ts @@ -58,7 +58,23 @@ class User extends ParanoidModel implements Searchable { role: UserRole; @observable - lastActiveAt: string; + protected _lastActiveAt: string; + + /** + * The last time the user was active. For the currently signed-in user, this + * always returns the current date so they always appear as recently active. + */ + @computed + get lastActiveAt(): string { + if (this.store.rootStore.auth?.currentUserId === this.id) { + return new Date(now(60000)).toISOString(); + } + return this._lastActiveAt; + } + + set lastActiveAt(value: string) { + this._lastActiveAt = value; + } @observable isSuspended: boolean; diff --git a/app/scenes/Settings/components/MembersTable.tsx b/app/scenes/Settings/components/MembersTable.tsx index 567a606f7b..5f3851f84f 100644 --- a/app/scenes/Settings/components/MembersTable.tsx +++ b/app/scenes/Settings/components/MembersTable.tsx @@ -110,7 +110,7 @@ export function MembersTable({ canManage, ...rest }: Props) { accessor: (user) => user.lastActiveAt, component: (user) => user.lastActiveAt ? ( -