From f6340eb0b32e30a88aa2ee944ad5a48cfc80c9d4 Mon Sep 17 00:00:00 2001 From: ferferga Date: Thu, 2 Apr 2020 20:11:10 +0200 Subject: [PATCH] Fix copy-paste typo and add comments --- src/controllers/userprofilespage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/userprofilespage.js b/src/controllers/userprofilespage.js index d7ffeedebf..955b8de521 100644 --- a/src/controllers/userprofilespage.js +++ b/src/controllers/userprofilespage.js @@ -125,10 +125,11 @@ define(["loading", "dom", "globalize", "date-fns", "dfnshelper", "paper-icon-but html += ""; return html + ""; } - + // FIXME: It seems that, sometimes, server sends date in the future, so date-fns displays messages like 'in less than a minute'. We should fix + // how dates are returned by the server when the session is active and show something like 'Active now', instead of past/future sentences function getLastSeenText(lastActivityDate) { if (lastActivityDate) { - return globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(session.LastActivityDate), { addSuffix: true, locale: dfnshelper.getLocale() })); + return globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(lastActivityDate), { addSuffix: true, locale: dfnshelper.getLocale() })); } return "";