Fix conversation lists

This commit is contained in:
2021-03-05 15:41:31 +01:00
parent 136db55703
commit 6dab962349
4 changed files with 21 additions and 24 deletions

View File

@ -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;
},
/**

View File

@ -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;