diff --git a/public/js/services/userServices.js b/public/js/services/userServices.js index 157aa322fd..c945cb3cdd 100644 --- a/public/js/services/userServices.js +++ b/public/js/services/userServices.js @@ -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) {