From 064603439783c9845ef1857920c0506a9600dde1 Mon Sep 17 00:00:00 2001
From: Arpit Jalan <arpit@techapj.com>
Date: Tue, 24 May 2016 19:33:59 +0530
Subject: [PATCH] FIX: respect mailing list confirmation dialog response

---
 .../javascripts/discourse/controllers/preferences.js.es6   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/assets/javascripts/discourse/controllers/preferences.js.es6 b/app/assets/javascripts/discourse/controllers/preferences.js.es6
index 733268a16..729f749af 100644
--- a/app/assets/javascripts/discourse/controllers/preferences.js.es6
+++ b/app/assets/javascripts/discourse/controllers/preferences.js.es6
@@ -134,13 +134,12 @@ export default Ember.Controller.extend(CanCheckEmails, {
       Em.run.next(()=>{
         const postsPerDay = this.get('model.mailing_list_posts_per_day');
         if (!postsPerDay || postsPerDay < 2) {
-          this.set('model.user_option.mailing_list_mode', true);
-          return;
+          return true;
         }
 
         bootbox.confirm(I18n.t("user.enable_mailing_list", {count: postsPerDay}), I18n.t("no_value"), I18n.t("yes_value"), (success) => {
-          if (success) {
-            this.set('model.user_option.mailing_list_mode', true);
+          if (!success) {
+            this.set('model.user_option.mailing_list_mode', false);
           }
         });
       });