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

Commit cb94fa5

Browse files
authored
DEV: Add condition for force-conversations-sidebar AppEvent (#1418)
1 parent 98afd7f commit cb94fa5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

assets/javascripts/discourse/services/ai-conversations-sidebar-manager.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ export default class AiConversationsSidebarManager extends Service {
8686

8787
forceCustomSidebar() {
8888
document.body.classList.add("has-ai-conversations-sidebar");
89+
if (!this.sidebarState.isForcingSidebar) {
90+
this.appEvents.trigger("discourse-ai:force-conversations-sidebar");
91+
}
92+
8993
this.sidebarState.isForcingSidebar = true;
9094

9195
// calling this before fetching data
9296
// helps avoid flash of main sidebar mode
9397
this.sidebarState.setPanel(AI_CONVERSATIONS_PANEL);
94-
95-
this.appEvents.trigger("discourse-ai:force-conversations-sidebar");
9698
this.sidebarState.setSeparatedMode();
9799
this.sidebarState.hideSwitchPanelButtons();
98100

0 commit comments

Comments
 (0)