fix language detection bug for FormFields service

This commit is contained in:
David Baldwynn 2017-11-02 10:41:36 -07:00
parent 6927f9d5ac
commit 076f56bf59
2 changed files with 6 additions and 5 deletions

View File

@ -1,10 +1,11 @@
'use strict';
//TODO: DAVID: URGENT: Make this a $resource that fetches valid field types from server
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', '$window',
function($rootScope, $translate, $window) {
$translate.use($window.user.language);
console.log($translate.instant('SHORT_TEXT'));
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', 'Auth',
function($rootScope, $translate, Auth) {
var language = Auth.ensureHasCurrentUser().language;
$translate.use(language);
this.types = [
{

View File

@ -22,7 +22,7 @@ angular.module('users').factory('Auth', ['$window',
} else if ($window.user){
service._currentUser = $window.user;
return service._currentUser;
} else{
} else {
User.getCurrent().then(function(user) {
// success
service._currentUser = user;