Skip to content

Commit

Permalink
Merge pull request #275 from dpalou/MOBILE-1306
Browse files Browse the repository at this point in the history
MOBILE-1306 courses: Fix missing addons after syncing site
  • Loading branch information
jleyva committed Nov 6, 2015
2 parents 9bb28d6 + 2beaf6f commit b3199d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion www/core/components/courses/services/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ angular.module('mm.core.courses')
*/
self.getUserCourse = function(id, preferCache, siteid) {
siteid = siteid || $mmSite.getId();

if (!id) {
return $q.reject();
}

if (typeof preferCache == 'undefined') {
preferCache = false;
}

return self.getUserCourses(preferCache, siteid).then(function(courses) {
var course;
angular.forEach(courses, function(c) {
if (c.id === id) {
if (c.id == id) {
course = c;
}
});
Expand Down
2 changes: 1 addition & 1 deletion www/core/components/courses/services/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ angular.module('mm.core.courses')
}).finally(function() {
// Update handlers for all courses.
angular.forEach(coursesHandlers, function(handler, courseId) {
self.updateNavHandlersForCourse(courseId);
self.updateNavHandlersForCourse(parseInt(courseId));
});
});
};
Expand Down

0 comments on commit b3199d7

Please sign in to comment.