DEV: Return promise for toggleFilteredRepliesView widget action. (#15020)

This allows plugin to wait on the promise when the widget action is
called.
This commit is contained in:
Alan Guo Xiang Tan 2021-11-19 15:40:35 +08:00 committed by GitHub
parent 4b4973ee0d
commit 1566cd2048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -483,9 +483,11 @@ createWidget("post-contents", {
) {
controller.send("cancelFilter", currentFilterPostNumber);
this.state.filteredRepliesShown = false;
return Promise.resolve();
} else {
this.state.filteredRepliesShown = true;
post
return post
.get("topic.postStream")
.filterReplies(post.post_number, post.id)
.then(() => {