mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Fix conversation lists
This commit is contained in:
@ -36,7 +36,7 @@ const ConversationsInterface = {
|
||||
var params = {}; //No params required now
|
||||
|
||||
//Perform the API request
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, function(results){
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, (results) => {
|
||||
|
||||
//Check for error
|
||||
if(results.error){
|
||||
@ -50,7 +50,7 @@ const ConversationsInterface = {
|
||||
//Process the list
|
||||
var conversationsList = {};
|
||||
for(i in results){
|
||||
conversationsList["conversation-"+results[i].ID] = results[i];
|
||||
conversationsList["conversation-"+results[i].id] = results[i];
|
||||
}
|
||||
|
||||
//Save the list in the cache
|
||||
@ -61,9 +61,6 @@ const ConversationsInterface = {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Success
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -212,7 +212,7 @@ const ConversationsList = {
|
||||
/**
|
||||
* Show a conversation entry
|
||||
*
|
||||
* @param {Object} conversationInfos Informations about the conversation
|
||||
* @param {Conversation} conversationInfos Informations about the conversation
|
||||
* @param {HTMLElement} entryTarget The target for the entry
|
||||
* @param {Object} listBox HTML elements about the listBox
|
||||
* @return {Boolean} True for a success
|
||||
@ -242,7 +242,7 @@ const ConversationsList = {
|
||||
|
||||
//Calculate last conversation activity
|
||||
var currentTime = ComunicWeb.common.date.time();
|
||||
lastActivityValueElem.innerHTML = " "+ComunicWeb.common.date.diffToStr(currentTime - conversationInfos.last_active);
|
||||
lastActivityValueElem.innerHTML = " "+ComunicWeb.common.date.diffToStr(currentTime - conversationInfos.last_activity);
|
||||
|
||||
|
||||
//Create the conversation name element
|
||||
@ -269,7 +269,7 @@ const ConversationsList = {
|
||||
|
||||
//Specify value
|
||||
var membersNumberValueElem = createElem("span", membersNumberSmallElem);
|
||||
membersNumberValueElem.innerHTML = (conversationInfos.members.length === 1 ? "1 member" : conversationInfos.members.length + " members");
|
||||
membersNumberValueElem.innerHTML = (conversationInfos.members.length === 1 ? tr("1 member") : conversationInfos.members.length + " members");
|
||||
|
||||
//Success
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user