mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-12 00:42:59 +00:00
Properly apply contactName & messageCount at conversation loading if reloading tab
This commit is contained in:
+11
-9
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user