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

@@ -32,9 +32,7 @@
params: []
};
Preferences.ready().then(function() {
vm.showSubscribedOnly = Preferences.defaults.SOGoMailShowSubscribedFoldersOnly;
});
this.showSubscribedOnly = Preferences.defaults.SOGoMailShowSubscribedFoldersOnly;
this.refreshUnseenCount();
@@ -258,7 +256,7 @@
}; // delegate
this.refreshUnseenCount = function() {
var unseenCountFolders = $window.unseenCountFolders;
var unseenCountFolders = $window.unseenCountFolders, refreshViewCheck;
_.forEach(vm.accounts, function(account) {
@@ -282,11 +280,9 @@
});
});
Preferences.ready().then(function() {
var refreshViewCheck = Preferences.defaults.SOGoRefreshViewCheck;
if (refreshViewCheck && refreshViewCheck != 'manually')
$timeout(vm.refreshUnseenCount, refreshViewCheck.timeInterval()*1000);
});
refreshViewCheck = Preferences.defaults.SOGoRefreshViewCheck;
if (refreshViewCheck && refreshViewCheck != 'manually')
$timeout(vm.refreshUnseenCount, refreshViewCheck.timeInterval()*1000);
};
this.isDroppableFolder = function(srcFolder, dstFolder) {