mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-12 23:15:26 +00:00
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:
@@ -7,11 +7,11 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
PreferencesController.$inject = ['$q', '$window', '$state', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', 'sgSettings', 'sgFocus', 'Dialog', 'User', 'Account', 'statePreferences', 'Authentication'];
|
||||
function PreferencesController($q, $window, $state, $mdMedia, $mdSidenav, $mdDialog, $mdToast, sgSettings, focus, Dialog, User, Account, statePreferences, Authentication) {
|
||||
PreferencesController.$inject = ['$q', '$window', '$state', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', 'sgSettings', 'sgFocus', 'Dialog', 'User', 'Account', 'Preferences', 'Authentication'];
|
||||
function PreferencesController($q, $window, $state, $mdMedia, $mdSidenav, $mdDialog, $mdToast, sgSettings, focus, Dialog, User, Account, Preferences, Authentication) {
|
||||
var vm = this, account, mailboxes = [], today = new Date(), tomorrow = today.beginOfDay().addDays(1);
|
||||
|
||||
vm.preferences = statePreferences;
|
||||
vm.preferences = Preferences;
|
||||
vm.passwords = { newPassword: null, newPasswordConfirmation: null };
|
||||
|
||||
vm.go = go;
|
||||
@@ -60,11 +60,9 @@
|
||||
}
|
||||
|
||||
// Set alternate avatar in User service
|
||||
statePreferences.ready().then(function() {
|
||||
if (statePreferences.defaults.SOGoAlternateAvatar)
|
||||
User.$alternateAvatar = statePreferences.defaults.SOGoAlternateAvatar;
|
||||
updateVacationDates();
|
||||
});
|
||||
if (Preferences.defaults.SOGoAlternateAvatar)
|
||||
User.$alternateAvatar = Preferences.defaults.SOGoAlternateAvatar;
|
||||
updateVacationDates();
|
||||
|
||||
function go(module, form) {
|
||||
if (form.$valid) {
|
||||
|
||||
Reference in New Issue
Block a user