mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: inaccurate tracking of current topic
Under some cases we would trigger the "you are replying on a different topic" when in fact, your were not
This commit is contained in:
parent
fe230f29cd
commit
9f1e8d4f58
@ -533,10 +533,13 @@ export default Ember.Controller.extend({
|
||||
// if we are replying to a topic AND not on the topic pop the window up
|
||||
if (!force && composer.get("replyingToTopic")) {
|
||||
const currentTopic = this.get("topicModel");
|
||||
if (
|
||||
!currentTopic ||
|
||||
currentTopic.get("id") !== composer.get("topic.id")
|
||||
) {
|
||||
|
||||
if (!currentTopic) {
|
||||
this.save(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentTopic.get("id") !== composer.get("topic.id")) {
|
||||
const message = I18n.t("composer.posting_not_on_topic");
|
||||
|
||||
let buttons = [
|
||||
@ -547,21 +550,19 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
];
|
||||
|
||||
if (currentTopic) {
|
||||
buttons.push({
|
||||
label:
|
||||
I18n.t("composer.reply_here") +
|
||||
"<br/><div class='topic-title overflow-ellipsis'>" +
|
||||
currentTopic.get("fancyTitle") +
|
||||
"</div>",
|
||||
class: "btn btn-reply-here",
|
||||
callback: () => {
|
||||
composer.set("topic", currentTopic);
|
||||
composer.set("post", null);
|
||||
this.save(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
buttons.push({
|
||||
label:
|
||||
I18n.t("composer.reply_here") +
|
||||
"<br/><div class='topic-title overflow-ellipsis'>" +
|
||||
currentTopic.get("fancyTitle") +
|
||||
"</div>",
|
||||
class: "btn btn-reply-here",
|
||||
callback: () => {
|
||||
composer.set("topic", currentTopic);
|
||||
composer.set("post", null);
|
||||
this.save(true);
|
||||
}
|
||||
});
|
||||
|
||||
buttons.push({
|
||||
label:
|
||||
|
@ -248,6 +248,8 @@ const TopicRoute = Discourse.Route.extend({
|
||||
this.screenTrack.stop();
|
||||
|
||||
this.appEvents.trigger("header:hide-topic");
|
||||
|
||||
this.controllerFor("topic").set("model", null);
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
|
Loading…
Reference in New Issue
Block a user