Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Sep 23, 2024
1 parent f614110 commit ab5b2e2
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 130 deletions.
10 changes: 0 additions & 10 deletions browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ using extensions::ChromeContentBrowserClientExtensionsPart;
#if BUILDFLAG(ENABLE_AI_CHAT)
#include "brave/browser/ui/webui/ai_chat/ai_chat_ui.h"
#include "brave/components/ai_chat/content/browser/ai_chat_tab_helper.h"
#include "brave/components/ai_chat/content/browser/ai_chat_throttle.h"
#include "brave/components/ai_chat/core/browser/utils.h"
#include "brave/components/ai_chat/core/common/features.h"
#include "brave/components/ai_chat/core/common/mojom/ai_chat.mojom.h"
Expand Down Expand Up @@ -1259,15 +1258,6 @@ BraveContentBrowserClient::CreateThrottlesForNavigation(
}
#endif

#if BUILDFLAG(ENABLE_AI_CHAT)
if (Profile::FromBrowserContext(context)->IsRegularProfile()) {
if (auto ai_chat_throttle =
ai_chat::AiChatThrottle::MaybeCreateThrottleFor(handle)) {
throttles.push_back(std::move(ai_chat_throttle));
}
}
#endif // ENABLE_AI_CHAT

return throttles;
}

Expand Down
2 changes: 0 additions & 2 deletions components/ai_chat/content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ static_library("browser") {
sources = [
"ai_chat_tab_helper.cc",
"ai_chat_tab_helper.h",
"ai_chat_throttle.cc",
"ai_chat_throttle.h",
"model_service_factory.cc",
"model_service_factory.h",
"page_content_fetcher.cc",
Expand Down
83 changes: 0 additions & 83 deletions components/ai_chat/content/browser/ai_chat_throttle.cc

This file was deleted.

31 changes: 0 additions & 31 deletions components/ai_chat/content/browser/ai_chat_throttle.h

This file was deleted.

2 changes: 0 additions & 2 deletions components/ai_chat/resources/page/chat_ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ function App() {

// Clean up bindings when not used anymore
React.useEffect(() => {
let cancel = false
return () => {
cancel = true
conversationAPI?.callbackRouter.$.close()
conversationAPI?.conversationHandler.$.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function PageTitleHeader(props: PageTitleHeaderProps) {
<Button
kind='plain-faint'
fab
onClick={() => {aiChatContext.onSelectConversationId(undefined)}}
onClick={() => {aiChatContext.onSelectConversationUuid(undefined)}}
>
<Icon name='arrow-left' />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Button from '@brave/leo/react/button'
import { useAIChat } from '../../state/ai_chat_context'
import { getLocale } from '$web-common/locale'
import getAPI from '../../api'
import { useConversation } from '../../state/conversation_context'

interface SimpleInputProps {
text?: string
Expand Down Expand Up @@ -110,6 +111,7 @@ interface SidebarNavProps {

export default function SidebarNav(props: SidebarNavProps) {
const aiChatContext = useAIChat()
const conversationContext = useConversation()
const [editingIndex, setEditingIndex] = React.useState<number | null>(null)

return (
Expand Down Expand Up @@ -148,7 +150,7 @@ export default function SidebarNav(props: SidebarNavProps) {
<div
className={classnames({
[styles.navItem]: true,
[styles.navItemActive]: item.uuid === aiChatContext.selectedConversationUuid
[styles.navItemActive]: item.uuid === conversationContext.conversationUuid
})}
onClick={() => {
aiChatContext.onSelectConversationUuid(item.uuid)
Expand Down

0 comments on commit ab5b2e2

Please sign in to comment.