Skip to content

Commit dde60aa

Browse files
committed
UX: don't render in admin sidebar
1 parent 5c8019b commit dde60aa

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import Component from "@glimmer/component";
22
import { action } from "@ember/object";
3+
import { service } from "@ember/service";
34
import DButton from "discourse/components/d-button";
45

56
export default class OneTrustPrefButton extends Component {
7+
@service sidebarState;
8+
9+
get shouldRender() {
10+
return this.sidebarState.currentPanelKey !== "admin";
11+
}
12+
613
@action
714
oneTrustTrigger() {
815
if (window.OneTrust) {
@@ -14,10 +21,12 @@ export default class OneTrustPrefButton extends Component {
1421
}
1522

1623
<template>
17-
<DButton
18-
@action={{this.oneTrustTrigger}}
19-
@label={{themePrefix "one_trust.button"}}
20-
class="btn-flat onetrust-pref"
21-
/>
24+
{{#if this.shouldRender}}
25+
<DButton
26+
@action={{this.oneTrustTrigger}}
27+
@label={{themePrefix "one_trust.button"}}
28+
class="btn-flat onetrust-pref"
29+
/>
30+
{{/if}}
2231
</template>
2332
}

0 commit comments

Comments
 (0)