FIX: A typo in bot filtration in ai-bot-header-icon (#1455)

* FIX: A typo in bot filtration in ai-bot-header-icon

* FIX: Show header icon when there's only one persona with a default LLM set

---------

Co-authored-by: Roman Rizzi <rizziromanalejandro@gmail.com>
This commit is contained in:
Jarek Radosz 2025-06-24 15:51:07 +02:00 committed by GitHub
parent 757c93e514
commit 5735f063a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ export default class AiBotHeaderIcon extends Component {
get bots() {
const availableBots = this.currentUser.ai_enabled_chat_bots
.filter((bot) => !bot.is_persosna)
.filter((bot) => !bot.is_persona || bot.has_default_llm)
.filter(Boolean);
return availableBots ? availableBots.map((bot) => bot.model_name) : [];

View File

@ -200,6 +200,7 @@ module DiscourseAi
{
"id" => persona_user[:user_id],
"username" => persona_user[:username],
"has_default_llm" => persona_user[:default_llm_id].present?,
"force_default_llm" => persona_user[:force_default_llm],
"is_persona" => true,
}