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 (
|
if (
|
||||||
composerController.get("model.topic.id") === topic.get("id") &&
|
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.post", post);
|
||||||
composerController.set("model.composeState", Composer.OPEN);
|
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) {
|
test("Can edit a post after starting a reply", async function (assert) {
|
||||||
await visit("/t/internationalization-localization/280");
|
await visit("/t/internationalization-localization/280");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue