From 2bc6df6937c2f33649060f102ce91886adc06ac3 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sat, 21 Nov 2015 19:38:32 +0300 Subject: [PATCH] Fixed send message bug --- app/js/directives.js | 3 --- app/js/messages_manager.js | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index 4bcfa5d4..86f9b6f6 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1645,13 +1645,10 @@ angular.module('myApp.directives', ['myApp.filters']) composer.onMentionsUpdated(); }); - var sendAwaiting = false; $scope.$on('ui_message_before_send', function () { - sendAwaiting = true; updateValue(); }); $scope.$on('ui_message_send', function () { - sendAwaiting = false; if (!Config.Navigator.touch) { focusField(); } diff --git a/app/js/messages_manager.js b/app/js/messages_manager.js index 18e0890e..7f4aa681 100644 --- a/app/js/messages_manager.js +++ b/app/js/messages_manager.js @@ -1359,8 +1359,9 @@ angular.module('myApp.services') historyStorage.pending.unshift(messageID); $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); + setZeroTimeout(message.send); // setTimeout(function () { - message.send(); + // message.send(); // }, 5000); pendingByRandomID[randomIDS] = [peerID, messageID]; @@ -1548,7 +1549,7 @@ angular.module('myApp.services') historyStorage.pending.unshift(messageID); $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); - message.send(); + setZeroTimeout(message.send); pendingByRandomID[randomIDS] = [peerID, messageID]; } @@ -1682,7 +1683,8 @@ angular.module('myApp.services') historyStorage.pending.unshift(messageID); $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); - message.send(); + setZeroTimeout(message.send); + pendingByRandomID[randomIDS] = [peerID, messageID]; }