Browse Source

Fixed empty history state

master
Igor Zhukov 10 years ago
parent
commit
af109eea13
  1. 5
      app/js/controllers.js
  2. 2
      app/partials/im.html

5
app/js/controllers.js

@ -335,6 +335,7 @@ angular.module('myApp.controllers', []) @@ -335,6 +335,7 @@ angular.module('myApp.controllers', [])
StatusManager.start();
$scope.history = [];
$scope.historyEmpty = false;
$scope.mediaType = false;
$scope.selectedMsgs = {};
$scope.selectedCount = 0;
@ -446,10 +447,12 @@ angular.module('myApp.controllers', []) @@ -446,10 +447,12 @@ angular.module('myApp.controllers', [])
? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID, startLimit)
: AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, startLimit);
$scope.historyEmpty = false;
getMessagesPromise.then(function (historyResult) {
if (curJump != jump) return;
historyResult.count === 0 ? $scope.mediaEmpty = true : $scope.mediaEmpty = false;
$scope.historyEmpty = !historyResult.count;
offset += startLimit;
hasMore = offset < historyResult.count;

2
app/partials/im.html

@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
<div class="im_history_scrollable">
<div class="im_history" ng-class="{im_history_selectable: selectActions}">
<div class="im_history_messages_none" ng-show="mediaEmpty">No messages to display</div>
<div class="im_history_messages_none" ng-show="historyEmpty &amp;&amp; !history.length">No messages to display</div>
<div class="im_history_message_wrap" my-message ng-repeat="historyMessage in history"></div>
</div>

Loading…
Cancel
Save