Commit c2129daa authored by Antek Grzanka's avatar Antek Grzanka

Quick fix!

parent 968d7a6c
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
$http.get('http://' + AppSettings.apiAddress + '/tasks'). $http.get('http://' + AppSettings.apiAddress + '/tasks').
success(function(data) { success(function(data) {
this.getMySolutions(function(solutions){ this.getMySolutions(function(solutions){
if (solutions){
data.filter(function(task){ data.filter(function(task){
return Object.keys(solutions).map(function(a){return parseInt(a);}).indexOf(task.level) !== -1; return Object.keys(solutions).map(function(a){return parseInt(a);}).indexOf(task.level) !== -1;
}).map(function(task){ }).map(function(task){
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
}); });
tasks = data; tasks = data;
if (callback) callback(data); if (callback) callback(data);
}
}); });
}.bind(this)); }.bind(this));
}, },
...@@ -36,9 +38,9 @@ ...@@ -36,9 +38,9 @@
}.bind(this)); }.bind(this));
} }
else { else {
result = scores[AuthenticationService.getTeamname()]; var team = AuthenticationService.getTeamname();
result = team ? scores[team] : undefined;
} }
console.debug("Result", result);
callback(result); callback(result);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment