window.env not available on frontpage, @paglias is this an ok workaround?

This commit is contained in:
Tyler Renelle
2013-12-07 11:56:22 -07:00
parent 79e8b2f4a5
commit e367985fa8

View File

@@ -56,7 +56,7 @@ angular.module('userServices', []).
sent.push(queue.shift());
});
$http.post(API_URL + '/api/v1/user/batch-update', sent, {params: {data:+new Date, _v:user._v, siteVersion: $window.env.siteVersion}})
$http.post(API_URL + '/api/v1/user/batch-update', sent, {params: {data:+new Date, _v:user._v, siteVersion: $window.env && $window.env.siteVersion}})
.success(function (data, status, heacreatingders, config) {
//make sure there are no pending actions to sync. If there are any it is not safe to apply model from server as we may overwrite user data.
if (!queue.length) {