From 4d1c6396c9f1ac8d6f923563cc1135e0e9790fba Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Wed, 18 May 2022 17:57:57 +0300 Subject: [PATCH] FIX: Allow users to select "regular" categories (#16857) Categories that had a CategoryUser record and the notification level set to "Normal" were not selectable in any of the "Watched", "Tracked", "Watching First Post" or "Muted" inputs. This happened because the category seemed to be already selected in the "Normal" input, but that does not exist (it is the default value if category is not present in any of the other inputs). --- .../discourse/app/controllers/preferences/categories.js | 7 ++----- .../javascripts/discourse/tests/fixtures/user-fixtures.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/categories.js b/app/assets/javascripts/discourse/app/controllers/preferences/categories.js index 862aedd3239..16555cdad91 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/categories.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/categories.js @@ -20,13 +20,10 @@ export default Controller.extend({ "model.watchedCategories", "model.watchedFirstPostCategories", "model.trackedCategories", - "model.regularCategories", "model.mutedCategories" ) - selectedCategories(watched, watchedFirst, tracked, regular, muted) { - return [] - .concat(watched, watchedFirst, tracked, regular, muted) - .filter((t) => t); + selectedCategories(watched, watchedFirst, tracked, muted) { + return [].concat(watched, watchedFirst, tracked, muted).filter((t) => t); }, @discourseComputed diff --git a/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js b/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js index 0883ca4a6f9..749f16fa0ab 100644 --- a/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js +++ b/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js @@ -178,7 +178,7 @@ export default { skip_new_user_tips: false, enable_quoting: true, muted_category_ids: [], - regular_category_ids: [], + regular_category_ids: [4], tracked_category_ids: [], watched_category_ids: [3], watched_first_post_category_ids: [],