diff --git a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 b/app/assets/javascripts/discourse/controllers/change-owner.js.es6 index 39ae9cddc..211e27a7e 100644 --- a/app/assets/javascripts/discourse/controllers/change-owner.js.es6 +++ b/app/assets/javascripts/discourse/controllers/change-owner.js.es6 @@ -39,11 +39,11 @@ export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, { username: this.get('new_user') }; - Discourse.Topic.changeOwners(this.get('topicController.model.id'), saveOpts).then(function(result) { + Discourse.Topic.changeOwners(this.get('topicController.model.id'), saveOpts).then(function() { // success self.send('closeModal'); self.get('topicController').send('toggleMultiSelect'); - Em.run.next(function() { DiscourseURL.routeTo(result.url); }); + Em.run.next(() => { DiscourseURL.routeTo(self.get("topicController.model.url")); }); }, function() { // failure self.flash(I18n.t('topic.change_owner.error'), 'alert-error'); diff --git a/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 b/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 index 1d55e74cf..1cd859cfa 100644 --- a/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 +++ b/app/assets/javascripts/discourse/controllers/change-timestamp.js.es6 @@ -1,5 +1,6 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality'; import computed from 'ember-addons/ember-computed-decorators'; +import DiscourseURL from 'discourse/lib/url'; // Modal related to changing the timestamp of posts export default Ember.Controller.extend(ModalFunctionality, { @@ -40,14 +41,16 @@ export default Ember.Controller.extend(ModalFunctionality, { actions: { changeTimestamp: function() { this.set('saving', true); - const self = this; + const self = this, + topic = this.get('topicController.model'); Discourse.Topic.changeTimestamp( - this.get('topicController.model.id'), + topic.get('id'), this.get('createdAt').unix() ).then(function() { self.send('closeModal'); self.setProperties({ date: '', time: '', saving: false }); + Em.run.next(() => { DiscourseURL.routeTo(topic.get('url')); }); }).catch(function() { self.flash(I18n.t('topic.change_timestamp.error'), 'alert-error'); self.set('saving', false);