Fixed multi dialogs bug

This commit is contained in:
Igor Zhukov 2014-01-27 00:47:37 +04:00
parent 63f5a5a4f1
commit 9af460a664
2 changed files with 5 additions and 2 deletions

View File

@ -48,7 +48,7 @@
<script type="text/javascript" src="js/lib/config.js"></script> <script type="text/javascript" src="js/lib/config.js"></script>
<script type="text/javascript" src="js/lib/mtproto.js?14"></script> <script type="text/javascript" src="js/lib/mtproto.js?15"></script>
<script type="text/javascript" src="js/util.js"></script> <script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/app.js?5"></script> <script type="text/javascript" src="js/app.js?5"></script>

View File

@ -423,7 +423,10 @@ angular.module('myApp.services', [])
NotificationsManager.start(); NotificationsManager.start();
function getDialogs (offset, limit) { function getDialogs (offset, limit) {
if (dialogsStorage.count !== null && dialogsStorage.dialogs.length >= offset + limit) { if (dialogsStorage.count !== null && (
dialogsStorage.dialogs.length >= offset + limit ||
dialogsStorage.dialogs.length == dialogsStorage.count
)) {
return $q.when({ return $q.when({
count: dialogsStorage.count, count: dialogsStorage.count,
dialogs: dialogsStorage.dialogs.slice(offset, offset + limit) dialogs: dialogsStorage.dialogs.slice(offset, offset + limit)