From 411985de3b3a12ac98a796a9f65ea95d747c9695 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 4 Jun 2014 16:33:22 -0400 Subject: [PATCH] FIX: Recursion with a computed property that was pointing to itself. --- app/assets/javascripts/discourse/models/category.js | 4 ---- .../discourse/templates/navigation/category.js.handlebars | 2 +- .../discourse/views/buttons/category_notifications_button.js | 2 -- test/javascripts/integration/discover_topics_test.js | 2 -- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/models/category.js b/app/assets/javascripts/discourse/models/category.js index 369a8e1541f..9687dfb8540 100644 --- a/app/assets/javascripts/discourse/models/category.js +++ b/app/assets/javascripts/discourse/models/category.js @@ -157,10 +157,6 @@ Discourse.Category = Discourse.Model.extend({ return this.countStats('topics'); }.property('posts_year', 'posts_month', 'posts_week', 'posts_day'), - notification_level: function() { - return this.get('notification_level'); - }.property('notification_level'), - setNotification: function(notification_level) { var url = "/category/" + this.get('id')+"/notifications"; this.set('notification_level', notification_level); diff --git a/app/assets/javascripts/discourse/templates/navigation/category.js.handlebars b/app/assets/javascripts/discourse/templates/navigation/category.js.handlebars index 5ec2c297e3a..f38f92d2a2b 100644 --- a/app/assets/javascripts/discourse/templates/navigation/category.js.handlebars +++ b/app/assets/javascripts/discourse/templates/navigation/category.js.handlebars @@ -8,7 +8,7 @@ {{#if canChangeCategoryNotificationLevel}} - {{view Discourse.CategoryNotificationsButton categoryBinding="model" category=category}} + {{view Discourse.CategoryNotificationsButton category=category}} {{/if}} {{#if canCreateTopic}} diff --git a/app/assets/javascripts/discourse/views/buttons/category_notifications_button.js b/app/assets/javascripts/discourse/views/buttons/category_notifications_button.js index 52954bb5070..684138225ba 100644 --- a/app/assets/javascripts/discourse/views/buttons/category_notifications_button.js +++ b/app/assets/javascripts/discourse/views/buttons/category_notifications_button.js @@ -10,8 +10,6 @@ Discourse.CategoryNotificationsButton = Discourse.NotificationsButton.extend({ classNames: ['notification-options', 'category-notification-menu'], buttonIncludesText: false, longDescriptionBinding: null, - category: Em.computed.alias('controller.model'), - target: Em.computed.alias('category'), hidden: Em.computed.alias('category.deleted'), notificationLevels: Discourse.Category.NotificationLevel, notificationLevel: Em.computed.alias('category.notification_level'), diff --git a/test/javascripts/integration/discover_topics_test.js b/test/javascripts/integration/discover_topics_test.js index c5dfda60f79..2930e0ed7a4 100644 --- a/test/javascripts/integration/discover_topics_test.js +++ b/test/javascripts/integration/discover_topics_test.js @@ -12,8 +12,6 @@ test("Default List", function() { test("List one Category", function() { expect(2); - this.stub(Discourse.User, "current").returns(null); - visit("/category/bug").then(function() { ok(exists("#topic-list"), "The list of topics was rendered"); ok(exists('#topic-list .topic-list-item'), "has topics");