mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Current user last active at (#11957)
* fix: Last active timestamp should always read as now for current user * Shorten language on members table
This commit is contained in:
+17
-1
@@ -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;
|
||||
|
||||
@@ -110,7 +110,7 @@ export function MembersTable({ canManage, ...rest }: Props) {
|
||||
accessor: (user) => user.lastActiveAt,
|
||||
component: (user) =>
|
||||
user.lastActiveAt ? (
|
||||
<Time dateTime={user.lastActiveAt} addSuffix />
|
||||
<Time dateTime={user.lastActiveAt} addSuffix shorten />
|
||||
) : null,
|
||||
width: "2fr",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user