Skip to content

Commit

Permalink
Merge pull request #673 from crazyserver/MOBILE-1619
Browse files Browse the repository at this point in the history
MOBILE-1619 home: Redirect to My courses if sitehome is forced but empty
  • Loading branch information
jleyva authored Oct 13, 2016
2 parents 517e598 + a4a84fe commit d995e63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion www/core/components/login/services/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ angular.module('mm.core.login')
// Configured to go to Site Home. Check if plugin is installed in the app.
var $mmaFrontpage = $mmAddonManager.get('$mmaFrontpage');
if ($mmaFrontpage) {
return $state.go('site.mm_course-section');
return $mmaFrontpage.isFrontpageAvailable().then(function() {
return $state.go('site.mm_course-section');
}).catch(function() {
return $state.go('site.mm_courses');
});
}
}

Expand Down

0 comments on commit d995e63

Please sign in to comment.