mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-15 03:52:13 -04:00
App startup improvements:
- do one and only one initialSync when the app starts. (recents-controller does not do its own anymore) - initialSync: get only the last message per room instead of default number of messages (10) Prevent recents-controller from loosing its data each time the page URL changes
This commit is contained in:
parent
972f664b6b
commit
21d6ce2380
3 changed files with 39 additions and 39 deletions
|
@ -36,7 +36,7 @@ angular.module('eventHandlerService', [])
|
|||
var CALL_EVENT = "CALL_EVENT";
|
||||
var NAME_EVENT = "NAME_EVENT";
|
||||
|
||||
var InitialSyncDeferred = $q.defer();
|
||||
var initialSyncDeferred = $q.defer();
|
||||
|
||||
$rootScope.events = {
|
||||
rooms: {} // will contain roomId: { messages:[], members:{userid1: event} }
|
||||
|
@ -220,14 +220,14 @@ angular.module('eventHandlerService', [])
|
|||
}
|
||||
},
|
||||
|
||||
handleInitialSyncDone: function() {
|
||||
handleInitialSyncDone: function(initialSyncData) {
|
||||
console.log("# handleInitialSyncDone");
|
||||
InitialSyncDeferred.resolve($rootScope.events, $rootScope.presence);
|
||||
initialSyncDeferred.resolve(initialSyncData);
|
||||
},
|
||||
|
||||
// Returns a promise that resolves when the initialSync request has been processed
|
||||
waitForInitialSyncCompletion: function() {
|
||||
return InitialSyncDeferred.promise;
|
||||
return initialSyncDeferred.promise;
|
||||
},
|
||||
|
||||
resetRoomMessages: function(room_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue