From 1a9c603ce2d52c696f0ada8f73d85675eca9774f Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 24 Mar 2015 19:24:56 +0300 Subject: [PATCH] Fixed send + load recent bug --- app/js/services.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/js/services.js b/app/js/services.js index b7436a56..f8304fd2 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -976,6 +976,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) historyStorage.count = historyResult.count || historyResult.messages.length; var offset = 0; + if (!maxID && historyResult.messages.length) { + maxID = historyResult.messages[0].id + 1; + } if (maxID > 0) { for (offset = 0; offset < historyStorage.history.length; offset++) { if (maxID > historyStorage.history[offset]) { @@ -2328,6 +2331,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } else { historyStorage = historiesStorage[peerID] = {count: null, history: [message.id], pending: []}; } + console.log('upd', historyStorage.history); saveMessages([message]);