From 1263af850bad86355601541a4385435fa1c51eb9 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 25 Jun 2015 21:12:42 +0000 Subject: [PATCH] Reinit message list before showing it to screen, else it merge :) --- js/public/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/public/app.js b/js/public/app.js index efe34a7..f50aaa7 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -66,7 +66,10 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' phoneNumberLabel = phoneNumberList.toString(); } + // Reinit messages before showing conversation + $scope.messages = []; $scope.formatConversation(jsondata); + if (typeof jsondata['contactName'] == 'undefined' || jsondata['contactName'] == '') { $('#ocsms-phone-label').html(phoneNumberLabel); g_curContactName = phoneNumberLabel; @@ -242,6 +245,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' }); } $scope.removeConversationMessage = function (msg) { + alert('test'); var len = $scope.messages.length; for (var i=0; i < len; i++) { var curMsg = $scope.messages[i];