DEV: Add condition for force-conversations-sidebar AppEvent

This commit is contained in:
rngus2344 2025-06-09 10:57:12 -05:00
parent 33fd6801e5
commit efdfe07aa6
No known key found for this signature in database
GPG Key ID: C4068B22851BAA95
1 changed files with 4 additions and 2 deletions

View File

@ -86,13 +86,15 @@ export default class AiConversationsSidebarManager extends Service {
forceCustomSidebar() {
document.body.classList.add("has-ai-conversations-sidebar");
if (!this.sidebarState.isForcingSidebar) {
this.appEvents.trigger("discourse-ai:force-conversations-sidebar");
}
this.sidebarState.isForcingSidebar = true;
// calling this before fetching data
// helps avoid flash of main sidebar mode
this.sidebarState.setPanel(AI_CONVERSATIONS_PANEL);
this.appEvents.trigger("discourse-ai:force-conversations-sidebar");
this.sidebarState.setSeparatedMode();
this.sidebarState.hideSwitchPanelButtons();