frontend: fix race condition in interface
This commit is contained in:
parent
129baaacee
commit
bd0416eede
1 changed files with 8 additions and 2 deletions
|
@ -182,10 +182,16 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
$rootScope.refresh();
|
||||
})
|
||||
.controller("ExerciceController", function($scope, $routeParams, $http, $rootScope, $timeout) {
|
||||
$rootScope.current_theme = $scope.themesUrl[$routeParams.theme];
|
||||
$scope.$watch("themesUrl", function(themesUrl) {
|
||||
if (themesUrl != undefined)
|
||||
$rootScope.current_theme = themesUrl[$routeParams.theme];
|
||||
})
|
||||
|
||||
if ($routeParams.exercice) {
|
||||
$rootScope.current_exercice = $scope.exercicesUrl[$routeParams.exercice];
|
||||
$scope.$watch("exercicesUrl", function(exercicesUrl) {
|
||||
if (exercicesUrl != undefined)
|
||||
$rootScope.current_exercice = exercicesUrl[$routeParams.exercice];
|
||||
})
|
||||
} else {
|
||||
if ($scope.themes && $scope.my && $scope.themes[$scope.current_theme]) {
|
||||
var exos = Object.keys($scope.themes[$scope.current_theme].exercices);
|
||||
|
|
Reference in a new issue