FIX: New Topic button regression in tag page (#12613)

FIX: New Topic button regression in tag page (#12613)

diff --git a/app/assets/javascripts/discourse/app/models/category-list.js b/app/assets/javascripts/discourse/app/models/category-list.js
index ce01fb4..b7a44e0 100644
--- a/app/assets/javascripts/discourse/app/models/category-list.js
+++ b/app/assets/javascripts/discourse/app/models/category-list.js
@@ -112,9 +112,6 @@ CategoryList.reopenClass({
           categories: this.categoriesFrom(store, result),
           can_create_category: result.category_list.can_create_category,
           can_create_topic: result.category_list.can_create_topic,
-          draft_key: result.category_list.draft_key,
-          draft: result.category_list.draft,
-          draft_sequence: result.category_list.draft_sequence,
         });
       }
     );
diff --git a/app/assets/javascripts/discourse/app/models/topic-list.js b/app/assets/javascripts/discourse/app/models/topic-list.js
index 8780012..da291e8 100644
--- a/app/assets/javascripts/discourse/app/models/topic-list.js
+++ b/app/assets/javascripts/discourse/app/models/topic-list.js
@@ -184,9 +184,6 @@ TopicList.reopenClass({
     json.inserted = json.inserted || [];
     json.can_create_topic = json.topic_list.can_create_topic;
     json.more_topics_url = json.topic_list.more_topics_url;
-    json.draft_key = json.topic_list.draft_key;
-    json.draft_sequence = json.topic_list.draft_sequence;
-    json.draft = json.topic_list.draft;
     json.for_period = json.topic_list.for_period;
     json.loaded = true;
     json.per_page = json.topic_list.per_page;
diff --git a/app/assets/javascripts/discourse/app/routes/discovery-categories.js b/app/assets/javascripts/discourse/app/routes/discovery-categories.js
index eeb402c..96e241d 100644
--- a/app/assets/javascripts/discourse/app/routes/discovery-categories.js
+++ b/app/assets/javascripts/discourse/app/routes/discovery-categories.js
@@ -64,9 +64,6 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
           topics: TopicList.topicsFrom(this.store, topicsList),
           can_create_category: categoriesList.can_create_category,
           can_create_topic: categoriesList.can_create_topic,
-          draft_key: categoriesList.draft_key,
-          draft: categoriesList.draft,
-          draft_sequence: categoriesList.draft_sequence,
         });
       }
       // Otherwise, return the ajax result
@@ -80,9 +77,6 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
           topics: TopicList.topicsFrom(this.store, result),
           can_create_category: result.category_list.can_create_category,
           can_create_topic: result.category_list.can_create_topic,
-          draft_key: result.category_list.draft_key,
-          draft: result.category_list.draft,
-          draft_sequence: result.category_list.draft_sequence,
         });
       });
     });
diff --git a/app/assets/javascripts/discourse/app/routes/tag-show.js b/app/assets/javascripts/discourse/app/routes/tag-show.js
index 6ffe1e5..36fcaa4 100644
--- a/app/assets/javascripts/discourse/app/routes/tag-show.js
+++ b/app/assets/javascripts/discourse/app/routes/tag-show.js
@@ -189,8 +189,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
           .open({
             categoryId: controller.get("category.id"),
             action: Composer.CREATE_TOPIC,
-            draftKey: controller.get("list.draft_key"),
-            draftSequence: controller.get("list.draft_sequence"),
+            draftKey: Composer.NEW_TOPIC_KEY,
           })
           .then(() => {
             // Pre-fill the tags input field
diff --git a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js b/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
index 79b84af..f3ee733 100644
--- a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
+++ b/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
@@ -69,8 +69,6 @@ export function applyDefaultHandlers(pretender) {
     if (loggedIn()) {
       // Stuff to let us post
       json.topic_list.can_create_topic = true;
-      json.topic_list.draft_key = "new_topic";
-      json.topic_list.draft_sequence = 1;
     }
     return response(json);
   });
@@ -81,8 +79,6 @@ export function applyDefaultHandlers(pretender) {
     if (loggedIn()) {
       // Stuff to let us post
       json.topic_list.can_create_topic = true;
-      json.topic_list.draft_key = "new_topic";
-      json.topic_list.draft_sequence = 1;
     }
     return response(json);
   });

GitHub sha: f56a22bd

This commit appears in #12613 which was approved by CvX. It was merged by pmusaraj.

This commit has been mentioned on Discourse Meta. There might be relevant details there: