mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-23 13:30:34 -04:00
Add recents-service to store shared state between recents-controllers.
Remove the selectedRoomId from rootScope and instead store it in recents-service. Add a broadcast to notify listeners (recents-controller) to updates of this.
This commit is contained in:
parent
e24d5cb97d
commit
96cd467cfa
5 changed files with 65 additions and 9 deletions
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'angular-peity'])
|
||||
.controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall', 'notificationService', 'modelService',
|
||||
function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall, notificationService, modelService) {
|
||||
.controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall', 'notificationService', 'modelService', 'recentsService',
|
||||
function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall, notificationService, modelService, recentsService) {
|
||||
'use strict';
|
||||
var MESSAGES_PER_PAGINATION = 30;
|
||||
var THUMBNAIL_SIZE = 320;
|
||||
|
@ -804,7 +804,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a
|
|||
console.log("onInit3");
|
||||
|
||||
// Make recents highlight the current room
|
||||
$rootScope.recentsSelectedRoomID = $scope.room_id;
|
||||
recentsService.setSelectedRoomId($scope.room_id);
|
||||
|
||||
// Init the history for this room
|
||||
history.init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue