Avoid double call of refresh at app startup
This commit is contained in:
parent
0e7a41dc99
commit
bcf8eb687a
|
@ -76,9 +76,9 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.refresh = function() {
|
var refresh = function() {
|
||||||
// List all rooms joined or been invited to
|
// List all rooms joined or been invited to
|
||||||
matrixService.rooms().then(
|
matrixService.rooms(1,true).then(
|
||||||
function(response) {
|
function(response) {
|
||||||
var data = assignRoomAliases(response.data.rooms);
|
var data = assignRoomAliases(response.data.rooms);
|
||||||
$scope.feedback = "Success";
|
$scope.feedback = "Success";
|
||||||
|
@ -118,7 +118,7 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
|
||||||
response.data.room_id);
|
response.data.room_id);
|
||||||
matrixService.createRoomIdToAliasMapping(
|
matrixService.createRoomIdToAliasMapping(
|
||||||
response.data.room_id, response.data.room_alias);
|
response.data.room_id, response.data.room_alias);
|
||||||
$scope.refresh();
|
refresh();
|
||||||
},
|
},
|
||||||
function(error) {
|
function(error) {
|
||||||
$scope.feedback = "Failure: " + error.data;
|
$scope.feedback = "Failure: " + error.data;
|
||||||
|
@ -158,5 +158,7 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.refresh();
|
$scope.onInit = function() {
|
||||||
|
refresh();
|
||||||
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div ng-controller="HomeController">
|
<div ng-controller="HomeController" data-ng-init="onInit()">
|
||||||
|
|
||||||
<div id="page">
|
<div id="page">
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
|
Loading…
Reference in New Issue