Expose user's settings and defaults inline

This improves performance by removing two AJAX calls and a lot of
JavaScript promises.
This commit is contained in:
Francis Lachapelle committed 2017-06-01 13:48:45 -04:00
1 parent 1fa056bb25
commit 89bfa0c536
22 files changed
+441 -484

No files matched your search

@@ -77,18 +77,15 @@
$element.off('click', toggleZoomFcn);
});
// Wait on user's defaults
Preferences.ready().then(function() {
$scope.$watch(function() { return vm.email; }, function(email, old) {
if (email && vm.urlEmail != email) {
// Email has changed or doesn't match the current URL (this happens when using md-virtual-repeat)
showGenericAvatar();
if (Preferences.defaults.SOGoGravatarEnabled)
getGravatar(email);
}
else if (!email)
showGenericAvatar();
});
$scope.$watch(function() { return vm.email; }, function(email, old) {
if (email && vm.urlEmail != email) {
// Email has changed or doesn't match the current URL (this happens when using md-virtual-repeat)
showGenericAvatar();
if (Preferences.defaults.SOGoGravatarEnabled)
getGravatar(email);
}
else if (!email)
showGenericAvatar();
});
// If sg-src is defined, watch the expression for the URL of a local image