Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0d292dc

Browse files
DEV: Use new core plugin API to register report mode
Introduced in discourse/discourse#31011
1 parent a53719a commit 0d292dc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { withPluginApi } from "discourse/lib/plugin-api";
2+
import AdminReportEmotion from "discourse/plugins/discourse-ai/discourse/components/admin-report-emotion";
3+
4+
export default {
5+
name: "discourse-ai-admin-reports",
6+
7+
initialize(container) {
8+
const currentUser = container.lookup("service:current-user");
9+
if (!currentUser || !currentUser.admin) {
10+
return;
11+
}
12+
13+
withPluginApi("2.0.1", (api) => {
14+
api.registerReportModeComponent("emotion", AdminReportEmotion);
15+
});
16+
},
17+
};

0 commit comments

Comments
 (0)