FIX: buildQuoteMarkdown fn was not passed down properly (#24360)

Followup to d128dc0e61,
I swear I tried this locally and it worked, but it turns
out it didn't. Need to keep the `action "function"` syntax
here.
This commit is contained in:
Martin Brennan 2023-11-14 10:42:41 +10:00 committed by GitHub
parent e5b0493b49
commit 014bb0adb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 12 deletions

View File

@ -457,18 +457,6 @@ export default Controller.extend(bufferedProperty("model"), {
});
},
buildQuoteMarkdown() {
const { postId, buffer, opts } = this.quoteState;
const loadedPost = this.get("model.postStream").findLoadedPost(postId);
const promise = loadedPost
? Promise.resolve(loadedPost)
: this.get("model.postStream").loadPost(postId);
return promise.then((post) => {
return buildQuote(post, buffer, opts);
});
},
fillGapBefore(args) {
return this.get("model.postStream").fillGapBefore(args.post, args.gap);
},
@ -1562,6 +1550,19 @@ export default Controller.extend(bufferedProperty("model"), {
this.model.recover();
},
@action
buildQuoteMarkdown() {
const { postId, buffer, opts } = this.quoteState;
const loadedPost = this.get("model.postStream").findLoadedPost(postId);
const promise = loadedPost
? Promise.resolve(loadedPost)
: this.get("model.postStream").loadPost(postId);
return promise.then((post) => {
return buildQuote(post, buffer, opts);
});
},
deleteTopic(opts = {}) {
if (opts.force_destroy) {
return this.model.destroy(this.currentUser, opts);