mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-18 03:47:59 +00:00
(js) Move Settings to a value in Common ng module
Also removed explicit settings and defaults that were imported in various app modules. We now always use the Preferences ng service.
This commit is contained in:
@@ -35,18 +35,20 @@
|
||||
* @desc The factory we'll use to register with Angular
|
||||
* @returns the Message constructor
|
||||
*/
|
||||
Message.$factory = ['$q', '$timeout', '$log', '$sce', 'sgSettings', 'Resource', function($q, $timeout, $log, $sce, Settings, Resource) {
|
||||
Message.$factory = ['$q', '$timeout', '$log', '$sce', 'sgSettings', 'Resource', 'Preferences', function($q, $timeout, $log, $sce, Settings, Resource, Preferences) {
|
||||
angular.extend(Message, {
|
||||
$q: $q,
|
||||
$timeout: $timeout,
|
||||
$log: $log,
|
||||
$sce: $sce,
|
||||
$$resource: new Resource(Settings.activeUser.folderURL + 'Mail', Settings.activeUser)
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Mail', Settings.activeUser())
|
||||
});
|
||||
// Initialize tags form user's defaults
|
||||
Preferences.ready().then(function() {
|
||||
if (Preferences.defaults.SOGoMailLabelsColors) {
|
||||
Message.$tags = Preferences.defaults.SOGoMailLabelsColors;
|
||||
}
|
||||
});
|
||||
|
||||
if (window.UserDefaults && window.UserDefaults.SOGoMailLabelsColors) {
|
||||
Message.$tags = window.UserDefaults.SOGoMailLabelsColors;
|
||||
}
|
||||
|
||||
return Message; // return constructor
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user