FIX: prevents expand post to trigger page routing (#8982)

This commit is contained in:
Joffrey JAFFEUX 2020-02-17 10:06:38 +01:00 committed by GitHub
parent e8efdd60d4
commit d827430ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -16,19 +16,21 @@ export default Component.extend({
if (this.expanded) { if (this.expanded) {
this.set("expanded", false); this.set("expanded", false);
item.set("expandedExcerpt", null); item.set("expandedExcerpt", null);
return; return false;
} }
const topicId = item.get("topic_id"); const topicId = item.get("topic_id");
const postNumber = item.get("post_number"); const postNumber = item.get("post_number");
this._loading = true; this._loading = true;
return ajax(`/posts/by_number/${topicId}/${postNumber}.json`) ajax(`/posts/by_number/${topicId}/${postNumber}.json`)
.then(result => { .then(result => {
this.set("expanded", true); this.set("expanded", true);
item.set("expandedExcerpt", result.cooked); item.set("expandedExcerpt", result.cooked);
}) })
.finally(() => (this._loading = false)); .finally(() => (this._loading = false));
return false;
} }
} }
}); });