DEV: Add group join/leave events (#12817)

DEV: Add group join/leave events (#12817)

diff --git a/app/assets/javascripts/discourse/app/components/group-membership-button.js b/app/assets/javascripts/discourse/app/components/group-membership-button.js
index 2849d16..46329bb 100644
--- a/app/assets/javascripts/discourse/app/components/group-membership-button.js
+++ b/app/assets/javascripts/discourse/app/components/group-membership-button.js
@@ -35,9 +35,13 @@ export default Component.extend({
   },
 
   removeFromGroup() {
-    this.model
+    const model = this.model;
+    model
       .removeMember(this.currentUser)
-      .then(() => this.model.set("is_group_user", false))
+      .then(() => {
+        model.set("is_group_user", false);
+        this.appEvents.trigger("group:leave", model);
+      })
       .catch(popupAjaxError)
       .finally(() => this.set("updatingMembership", false));
   },
@@ -52,6 +56,7 @@ export default Component.extend({
           .addMembers(this.currentUser.get("username"))
           .then(() => {
             model.set("is_group_user", true);
+            this.appEvents.trigger("group:join", model);
           })
           .catch(popupAjaxError)
           .finally(() => {

GitHub sha: dd3e16c1

This commit appears in #12817 which was approved by eviltrout. It was merged by pmusaraj.