Skip to content

Commit

Permalink
DEV: Show only for admins (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegangeorge committed Jun 14, 2023
1 parent 95b3d16 commit 2fa8afd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascripts/discourse/api-initializers/dev-utils.js
Expand Up @@ -2,6 +2,12 @@ import { apiInitializer } from "discourse/lib/api";
import showModal from "discourse/lib/show-modal";

export default apiInitializer("0.11.1", (api) => {
const currentUser = api.getCurrentUser();

if (!currentUser?.admin) {
return;
}

if (settings.show_header_button) {
api.decorateWidget("header-icons:before", (helper) => {
return helper.attach("header-dropdown", {
Expand Down

0 comments on commit 2fa8afd

Please sign in to comment.