mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Prepared conversation callback function
This commit is contained in:
parent
8764187273
commit
fee007d127
@ -274,10 +274,6 @@ ComunicWeb.components.conversations.interface = {
|
||||
*/
|
||||
refreshConversations: function(newConversations, toRefresh, callback){
|
||||
|
||||
//DEBUG log informations
|
||||
console.log("New conversations", newConversations);
|
||||
console.log("To refresh", toRefresh);
|
||||
|
||||
//Perform a request on the API
|
||||
var apiURI = "conversations/refresh";
|
||||
var params = {
|
||||
|
@ -135,10 +135,21 @@ ComunicWeb.components.conversations.service = {
|
||||
/**
|
||||
* Service callback function
|
||||
*
|
||||
* @param {Object}
|
||||
* @param {Object} result The result of the request
|
||||
* @return {Boolean} True for a success
|
||||
*/
|
||||
callback: function(){
|
||||
callback: function(result){
|
||||
|
||||
//Check for errors
|
||||
if(result.error){
|
||||
ComunicWeb.debug.logMessage("Conversations Service : Couldn't update conversations !");
|
||||
|
||||
//Display a notification
|
||||
ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to refresh conversations system !", "danger", 1.5);
|
||||
}
|
||||
else {
|
||||
//We can continue with the result
|
||||
}
|
||||
|
||||
//Unlock service
|
||||
this.__serviceLock = false;
|
||||
|
Loading…
Reference in New Issue
Block a user