@@ -5,9 +5,9 @@ import angular from 'angular'
55
66 angular . module ( 'tc.settings' ) . controller ( 'EmailSettingsController' , EmailSettingsController )
77
8- EmailSettingsController . $inject = [ '$rootScope' , 'userProfile ' , 'ProfileService' , 'MailchimpService' , 'logger' , 'CONSTANTS' , 'toaster' , '$q' , '$scope' ]
8+ EmailSettingsController . $inject = [ '$rootScope' , 'userData ' , 'ProfileService' , 'MailchimpService' , 'logger' , 'CONSTANTS' , 'toaster' , '$q' , '$scope' ]
99
10- function EmailSettingsController ( $rootScope , userProfile , ProfileService , MailchimpService , logger , CONSTANTS , toaster , $q , $scope ) {
10+ function EmailSettingsController ( $rootScope , userData , ProfileService , MailchimpService , logger , CONSTANTS , toaster , $q , $scope ) {
1111 var vm = this
1212 vm . loading = false
1313 vm . saving = false
@@ -34,7 +34,7 @@ import angular from 'angular'
3434 } ,
3535 {
3636 id : CONSTANTS . MAILCHIMP_NL_DEV ,
37- name : 'Developer Newsletter' ,
37+ name : 'Development Newsletter' ,
3838 desc : 'Software architecture, component assembly, application development, and bug hunting' ,
3939 enabled : false ,
4040 dirty : false
@@ -63,11 +63,11 @@ import angular from 'angular'
6363 ]
6464
6565 vm . loading = true
66- return MailchimpService . getMemberSubscription ( userProfile ) . then ( function ( subscription ) {
66+ return MailchimpService . getMemberSubscription ( userData ) . then ( function ( subscription ) {
6767 vm . loading = false
6868 if ( ! subscription ) {
69- // add member to the list with empty preferences
70- MailchimpService . addSubscription ( userProfile , { } ) . then ( function ( resp ) {
69+ // add member to the list with default preferences
70+ MailchimpService . addSubscription ( userData , { } ) . then ( function ( resp ) {
7171 logger . debug ( resp )
7272 } ) . catch ( function ( err ) {
7373 // no error to user
@@ -102,7 +102,7 @@ import angular from 'angular'
102102 vm . newsletters . forEach ( function ( newsletter ) {
103103 preferences [ newsletter . id ] = newsletter . enabled
104104 } )
105- MailchimpService . addSubscription ( userProfile , preferences ) . then ( function ( resp ) {
105+ MailchimpService . addSubscription ( userData , preferences ) . then ( function ( resp ) {
106106 vm . loading = false
107107 vm . saving = false
108108 // reset dirty state for all newsletter options
0 commit comments