summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-26 16:57:29 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-26 16:57:41 +0200
commitbcf8eb687a35d634b004985fd858a660e8ccb9e9 (patch)
tree8d32192d4c0012ab6b3f208dfb1ce419fa9cc19e
parentMerge branch 'client_server_url_rename' into develop (diff)
downloadsynapse-bcf8eb687a35d634b004985fd858a660e8ccb9e9.tar.xz
Avoid double call of refresh at app startup
-rw-r--r--webclient/home/home-controller.js10
-rw-r--r--webclient/home/home.html2
2 files changed, 7 insertions, 5 deletions
diff --git a/webclient/home/home-controller.js b/webclient/home/home-controller.js
index a5576759fa..867ae522a6 100644
--- a/webclient/home/home-controller.js
+++ b/webclient/home/home-controller.js
@@ -76,9 +76,9 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
         return data;
     };
 
-    $scope.refresh = function() {
+    var refresh = function() {
         // List all rooms joined or been invited to
-        matrixService.rooms().then(
+        matrixService.rooms(1,true).then(
             function(response) {
                 var data = assignRoomAliases(response.data.rooms);
                 $scope.feedback = "Success";
@@ -118,7 +118,7 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
                 response.data.room_id);
                 matrixService.createRoomIdToAliasMapping(
                     response.data.room_id, response.data.room_alias);
-                $scope.refresh();
+                refresh();
             },
             function(error) {
                 $scope.feedback = "Failure: " + error.data;
@@ -158,5 +158,7 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
         );
     };
  
-    $scope.refresh();
+    $scope.onInit = function() {
+        refresh();
+    };
 }]);
diff --git a/webclient/home/home.html b/webclient/home/home.html
index 4818d414b6..4084f4c388 100644
--- a/webclient/home/home.html
+++ b/webclient/home/home.html
@@ -1,4 +1,4 @@
-<div ng-controller="HomeController">
+<div ng-controller="HomeController" data-ng-init="onInit()">
 
     <div id="page">
     <div id="wrapper">