Skip to content

Commit

Permalink
Fixes browser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyZhukovsky committed Sep 11, 2024
1 parent 00844ae commit 4756a38
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions browser/ui/webui/ai_chat/ai_chat_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ AIChatUI::AIChatUI(content::WebUI* web_ui)
#endif

untrusted_source->AddBoolean("isMobile", kIsMobile);
ai_chat::AIChatTabHelper* active_chat_tab_helper =
ai_chat::AIChatTabHelper::FromWebContents(GetChatWebContents());
untrusted_source->AddBoolean(
"hasInitialHistory",
active_chat_tab_helper->GetVisibleConversationHistory().size() != 0);
content::WebContents* chat_web_contents = GetChatWebContents();
size_t visible_conversation_history_size = 0;
if (chat_web_contents) {
ai_chat::AIChatTabHelper* active_chat_tab_helper =
ai_chat::AIChatTabHelper::FromWebContents(chat_web_contents);
visible_conversation_history_size =
active_chat_tab_helper->GetVisibleConversationHistory().size();
}
untrusted_source->AddBoolean("hasInitialHistory",
visible_conversation_history_size != 0);

untrusted_source->AddBoolean(
"hasUserDismissedPremiumPrompt",
Expand Down

0 comments on commit 4756a38

Please sign in to comment.