1
0
mirror of synced 2026-08-11 04:37:02 +00:00

DEV: add appEvent for solution-toggled (#273)

This commit is contained in:
Kris
2023-12-20 11:58:47 -05:00
committed by GitHub
parent 5c84152b06
commit dd8ebd24e8
@@ -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 });
@@ -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 });