mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:40:00 +08:00
FIX: Replying to OP is a reply to the topic, not the post (#23380)
Clicking on the OP's Reply button twice results in the post being a reply to post number 1. This is a fix for that.
This commit is contained in:
parent
7ea3079e3e
commit
187f9a9495
|
@ -657,7 +657,8 @@ export default Controller.extend(bufferedProperty("model"), {
|
|||
|
||||
if (
|
||||
composerController.get("model.topic.id") === topic.get("id") &&
|
||||
composerController.get("model.action") === Composer.REPLY
|
||||
composerController.get("model.action") === Composer.REPLY &&
|
||||
post?.get("post_number") !== 1
|
||||
) {
|
||||
composerController.set("model.post", post);
|
||||
composerController.set("model.composeState", Composer.OPEN);
|
||||
|
|
|
@ -334,6 +334,22 @@ acceptance("Composer", function (needs) {
|
|||
);
|
||||
});
|
||||
|
||||
test("Replying to the first post in a topic is a topic reply", async function (assert) {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
||||
await click("#post_1 .reply.create");
|
||||
assert.strictEqual(
|
||||
query(".reply-details a.topic-link").innerText,
|
||||
"Internationalization / localization"
|
||||
);
|
||||
|
||||
await click("#post_1 .reply.create");
|
||||
assert.strictEqual(
|
||||
query(".reply-details a.topic-link").innerText,
|
||||
"Internationalization / localization"
|
||||
);
|
||||
});
|
||||
|
||||
test("Can edit a post after starting a reply", async function (assert) {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user