mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-10 01:13:20 +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:
@@ -48,16 +48,15 @@
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Mail', Settings.activeUser()),
|
||||
$avatar: angular.bind(Preferences, Preferences.avatar)
|
||||
});
|
||||
|
||||
// Initialize tags form user's defaults
|
||||
Preferences.ready().then(function() {
|
||||
if (Preferences.defaults.SOGoMailLabelsColors) {
|
||||
Message.$tags = Preferences.defaults.SOGoMailLabelsColors;
|
||||
}
|
||||
if (Preferences.defaults.SOGoMailDisplayRemoteInlineImages &&
|
||||
Preferences.defaults.SOGoMailDisplayRemoteInlineImages == 'always') {
|
||||
Message.$displayRemoteInlineImages = true;
|
||||
}
|
||||
});
|
||||
if (Preferences.defaults.SOGoMailLabelsColors) {
|
||||
Message.$tags = Preferences.defaults.SOGoMailLabelsColors;
|
||||
}
|
||||
if (Preferences.defaults.SOGoMailDisplayRemoteInlineImages &&
|
||||
Preferences.defaults.SOGoMailDisplayRemoteInlineImages == 'always') {
|
||||
Message.$displayRemoteInlineImages = true;
|
||||
}
|
||||
|
||||
return Message; // return constructor
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user