mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #3649 from tgxworld/click_reply_should_clear_edit
Click reply should clear edit
This commit is contained in:
@@ -398,7 +398,8 @@ export default Ember.Controller.extend({
|
||||
|
||||
// If we're already open, we don't have to do anything
|
||||
if (composerModel.get('composeState') === Discourse.Composer.OPEN &&
|
||||
composerModel.get('draftKey') === opts.draftKey) {
|
||||
composerModel.get('draftKey') === opts.draftKey &&
|
||||
composerModel.get('action') === opts.action ) {
|
||||
return resolve();
|
||||
}
|
||||
|
||||
@@ -406,7 +407,7 @@ export default Ember.Controller.extend({
|
||||
if (composerModel.get('composeState') === Discourse.Composer.DRAFT &&
|
||||
composerModel.get('draftKey') === opts.draftKey) {
|
||||
composerModel.set('composeState', Discourse.Composer.OPEN);
|
||||
return resolve();
|
||||
if (composerModel.get('action') === opts.action) return resolve();
|
||||
}
|
||||
|
||||
// If it's a different draft, cancel it and try opening again.
|
||||
|
||||
@@ -371,12 +371,11 @@ const Composer = RestModel.extend({
|
||||
|
||||
const composer = this;
|
||||
if (!replyBlank &&
|
||||
(opts.action !== this.get('action') || ((opts.reply || opts.action === this.EDIT) && this.get('reply') !== this.get('originalText'))) &&
|
||||
!opts.tested) {
|
||||
opts.tested = true;
|
||||
((opts.reply || opts.action === this.EDIT) && this.get('replyDirty'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (opts.action === REPLY && this.get('action') === EDIT) this.set('reply', '');
|
||||
if (!opts.draftKey) throw 'draft key is required';
|
||||
if (opts.draftSequence === null) throw 'draft sequence is required';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user