mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: various fixes to draft system
- destroyDraft which is called when we cancel a draft is now async, removing race conditions when you click "reply" to a post and are already editing. We used to trigger double dialogs for cancelling drafts which was confusing. - Remove reply as new topic / reply as pm keys, they are no longer used and only caused confustion. For example we used to pop up a warning when you are composing a reply and flick to reply as new topic - Remove createTopic key, this was a bug that proliferated. Whenever creating a topic via the C shortcut or clicking on new topic on full screen search the correct new topic draft key will be used consistently - When abandoning an edit we now say "Are you sure you want to discard your changes" (instead of abandon your post which is confusing)
This commit is contained in:
@ -5,8 +5,7 @@ import {
|
||||
CREATE_TOPIC,
|
||||
CREATE_SHARED_DRAFT,
|
||||
REPLY,
|
||||
EDIT,
|
||||
NEW_PRIVATE_MESSAGE_KEY
|
||||
EDIT
|
||||
} from "discourse/models/composer";
|
||||
|
||||
// Component can get destroyed and lose state
|
||||
@ -209,7 +208,6 @@ export default DropdownSelectBoxComponent.extend({
|
||||
|
||||
_replyFromExisting(options, post, topic) {
|
||||
this.closeComposer();
|
||||
|
||||
this.openComposer(options, post, topic);
|
||||
},
|
||||
|
||||
@ -244,6 +242,7 @@ export default DropdownSelectBoxComponent.extend({
|
||||
options.action = CREATE_TOPIC;
|
||||
options.categoryId = this.get("composerModel.topic.category.id");
|
||||
options.disableScopedCategory = true;
|
||||
options.skipDraftCheck = true;
|
||||
this._replyFromExisting(options, _postSnapshot, _topicSnapshot);
|
||||
},
|
||||
|
||||
@ -269,7 +268,7 @@ export default DropdownSelectBoxComponent.extend({
|
||||
options.action = PRIVATE_MESSAGE;
|
||||
options.usernames = usernames;
|
||||
options.archetypeId = "private_message";
|
||||
options.draftKey = NEW_PRIVATE_MESSAGE_KEY;
|
||||
options.skipDraftCheck = true;
|
||||
|
||||
this._replyFromExisting(options, _postSnapshot, _topicSnapshot);
|
||||
},
|
||||
|
Reference in New Issue
Block a user