diff --git a/assets/javascripts/initializers/ai-chat-summarization.js b/assets/javascripts/initializers/ai-chat-summarization.js index b2ba6e74..1b17ec5c 100644 --- a/assets/javascripts/initializers/ai-chat-summarization.js +++ b/assets/javascripts/initializers/ai-chat-summarization.js @@ -11,7 +11,11 @@ export default apiInitializer("1.34.0", (api) => { currentUser && currentUser.can_summarize; - if (!chatService.userCanChat || !siteSettings.chat_enabled || !canSummarize) { + if ( + !siteSettings.chat_enabled || + !chatService?.userCanChat || + !canSummarize + ) { return; }