From 9af460a6644e483a024aff80de7868e089030c43 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 27 Jan 2014 00:47:37 +0400 Subject: [PATCH] Fixed multi dialogs bug --- app/index.html | 2 +- app/js/services.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index b564875d..81180340 100644 --- a/app/index.html +++ b/app/index.html @@ -48,7 +48,7 @@ - + diff --git a/app/js/services.js b/app/js/services.js index bee47a03..ef4be374 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -423,7 +423,10 @@ angular.module('myApp.services', []) NotificationsManager.start(); 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({ count: dialogsStorage.count, dialogs: dialogsStorage.dialogs.slice(offset, offset + limit)