[#1489] populate user to Members service on initial load, so it will show self

as leaderMessage if you're the leader of a group
This commit is contained in:
Tyler Renelle 2013-09-09 17:23:09 -04:00
parent e1828153dd
commit 87c2a5b57d

View file

@ -5,8 +5,8 @@
*/
angular.module('userServices', []).
factory('User', ['$http', '$location', 'API_URL', 'STORAGE_USER_ID', 'STORAGE_SETTINGS_ID',
function($http, $location, API_URL, STORAGE_USER_ID, STORAGE_SETTINGS_ID) {
factory('User', ['$http', '$location', 'API_URL', 'STORAGE_USER_ID', 'STORAGE_SETTINGS_ID', 'Members',
function($http, $location, API_URL, STORAGE_USER_ID, STORAGE_SETTINGS_ID, Members) {
var authenticated = false,
defaultSettings = {
auth: { apiId: '', apiToken: ''},
@ -70,6 +70,7 @@ angular.module('userServices', []).
_.extend(user, data);
}
user._v = data._v;
Members.populate(user);
// FIXME handle this somewhere else, we don't need to check every single time
var offset = moment().zone(); // eg, 240 - this will be converted on server as -(offset/60)