mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 11:15:43 +08:00
REGRESSION: not navigating to topic when replying (and not on topic)
This commit is contained in:
parent
fb41816003
commit
b1c18367e4
@ -1,7 +1,7 @@
|
|||||||
import DiscourseController from 'discourse/controllers/controller';
|
import DiscourseController from 'discourse/controllers/controller';
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
export default DiscourseController.extend({
|
||||||
needs: ['modal', 'topic', 'composer-messages'],
|
needs: ['modal', 'topic', 'composer-messages', 'application'],
|
||||||
|
|
||||||
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),
|
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),
|
||||||
checkedMessages: false,
|
checkedMessages: false,
|
||||||
@ -233,6 +233,8 @@ export default DiscourseController.extend({
|
|||||||
currentUser.set('reply_count', currentUser.get('reply_count') + 1);
|
currentUser.set('reply_count', currentUser.get('reply_count') + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO disableJumpReply is super crude, it needs to provide some sort
|
||||||
|
// of notification to the end user
|
||||||
if (!composer.get('replyingToTopic') || !disableJumpReply) {
|
if (!composer.get('replyingToTopic') || !disableJumpReply) {
|
||||||
if (opts.post && !staged) {
|
if (opts.post && !staged) {
|
||||||
Discourse.URL.routeTo(opts.post.get('url'));
|
Discourse.URL.routeTo(opts.post.get('url'));
|
||||||
@ -243,7 +245,11 @@ export default DiscourseController.extend({
|
|||||||
bootbox.alert(error);
|
bootbox.alert(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
staged = composer.get('stagedPost');
|
|
||||||
|
if ( this.get('controllers.application.currentRouteName').split('.')[0] === 'topic' &&
|
||||||
|
composer.get('topic.id') === this.get('controllers.topic.model.id') ) {
|
||||||
|
staged = composer.get('stagedPost');
|
||||||
|
}
|
||||||
|
|
||||||
Em.run.schedule('afterRender', function() {
|
Em.run.schedule('afterRender', function() {
|
||||||
if (staged && !disableJumpReply) {
|
if (staged && !disableJumpReply) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user