Browse Source

Clear dialogs cache

master
Igor Zhukov 9 years ago
parent
commit
5b98c89d08
  1. 1
      app/js/controllers.js
  2. 5
      app/js/messages_manager.js

1
app/js/controllers.js

@ -699,6 +699,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
dialog = $scope.dialogs[i]; dialog = $scope.dialogs[i];
if (dialogsUpdated[dialog.peerID]) { if (dialogsUpdated[dialog.peerID]) {
$scope.dialogs.splice(i, 1); $scope.dialogs.splice(i, 1);
AppMessagesManager.clearDialogCache($scope.dialogs.mid);
i--; i--;
len--; len--;
} }

5
app/js/messages_manager.js

@ -2019,6 +2019,10 @@ angular.module('myApp.services')
return message; return message;
} }
function clearDialogCache (msgID) {
delete messagesForDialogs[msgID];
}
function wrapForHistory (msgID) { function wrapForHistory (msgID) {
if (messagesForHistory[msgID] !== undefined) { if (messagesForHistory[msgID] !== undefined) {
return messagesForHistory[msgID]; return messagesForHistory[msgID];
@ -2980,6 +2984,7 @@ angular.module('myApp.services')
convertMigratedPeer: convertMigratedPeer, convertMigratedPeer: convertMigratedPeer,
getMessagePeer: getMessagePeer, getMessagePeer: getMessagePeer,
getMessageThumb: getMessageThumb, getMessageThumb: getMessageThumb,
clearDialogCache: clearDialogCache,
wrapForDialog: wrapForDialog, wrapForDialog: wrapForDialog,
wrapForHistory: wrapForHistory, wrapForHistory: wrapForHistory,
wrapReplyMarkup: wrapReplyMarkup, wrapReplyMarkup: wrapReplyMarkup,

Loading…
Cancel
Save