1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Properly apply contactName & messageCount at conversation loading if reloading tab

This commit is contained in:
Loic Blot 2016-09-22 22:21:33 +02:00
parent 852c0835fa
commit a512ee4957

View File

@ -157,16 +157,18 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
// Reinit messages before showing conversation
$scope.formatConversation(jsondata);
if (typeof jsondata['contactName'] == 'undefined' || jsondata['contactName'] == '') {
$scope.selectedContact.label = phoneNumberLabel;
$scope.selectedContact.opt_numbers = "";
}
else {
$scope.selectedContact.label = jsondata['contactName'];
$scope.selectedContact.opt_numbers = phoneNumberLabel;
}
$scope.$apply(function () {
if (typeof jsondata['contactName'] == 'undefined' || jsondata['contactName'] == '') {
$scope.selectedContact.label = phoneNumberLabel;
$scope.selectedContact.opt_numbers = "";
}
else {
$scope.selectedContact.label = jsondata['contactName'];
$scope.selectedContact.opt_numbers = phoneNumberLabel;
}
$scope.totalMessageCount = jsondata['msgCount'] !== undefined ? jsondata['msgCount'] : 0;
$scope.totalMessageCount = jsondata['msgCount'] !== undefined ? jsondata['msgCount'] : 0;
}
$('#app-content').scrollTop(1E10);
}