Determine whether user is signed in or not on sidebar

This commit is contained in:
Pierre HUBERT 2019-05-16 18:26:35 +02:00
parent 18f7fbc304
commit 30743601a9

View File

@ -226,8 +226,14 @@ ComunicWeb.components.sideBar.main = {
onclick: (e) => e.stopImmediatePropagation() onclick: (e) => e.stopImmediatePropagation()
}); });
if(friend.accepted == 1) // Check if friendship request has been accepted or not
subInfoEl.innerHTML = timeDiffToStr(friend.time_last_activity); if(friend.accepted == 1) {
if(ComunicWeb.common.date.time() - friend.time_last_activity < 30)
subInfoEl.innerHTML = "<span style='color: green;'>Online</span>";
else
subInfoEl.innerHTML = timeDiffToStr(friend.time_last_activity);
}
else { else {
const respondRequest = function(accept) { const respondRequest = function(accept) {