Skip to content

Commit

Permalink
DEV: add appEvent for solution-toggled (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot committed Dec 20, 2023
1 parent 5c84152 commit dd8ebd2
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -173,6 +173,8 @@ function initializeWithApi(api) {
const post = this.model;
acceptPost(post);

this.appEvents.trigger("discourse-solved:solution-toggled", post);

post.get("topic.postStream.posts").forEach((p) => {
p.set("topic_accepted_answer", true);
this.appEvents.trigger("post-stream:refresh", { id: p.id });
Expand All @@ -183,6 +185,8 @@ function initializeWithApi(api) {
const post = this.model;
unacceptPost(post);

this.appEvents.trigger("discourse-solved:solution-toggled", post);

post.get("topic.postStream.posts").forEach((p) => {
p.set("topic_accepted_answer", false);
this.appEvents.trigger("post-stream:refresh", { id: p.id });
Expand Down

0 comments on commit dd8ebd2

Please sign in to comment.