mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-17 02:25:57 +00:00
fix: bug in storage selector from side panel (#265)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
|
||||
"root": false,
|
||||
"extends": "//",
|
||||
"vcs": {
|
||||
|
||||
@@ -146,7 +146,6 @@ export const NewTab = () => {
|
||||
query: searchQuery,
|
||||
mode: 'agent',
|
||||
action,
|
||||
workingDir: selectedFolder?.path,
|
||||
})
|
||||
break
|
||||
}
|
||||
@@ -164,7 +163,6 @@ export const NewTab = () => {
|
||||
query: item.message,
|
||||
mode: item.mode,
|
||||
action,
|
||||
workingDir: selectedFolder?.path,
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { formatConversationHistory } from '@/lib/conversations/formatConversatio
|
||||
import { useLlmProviders } from '@/lib/llm-providers/useLlmProviders'
|
||||
import { track } from '@/lib/metrics/track'
|
||||
import { searchActionsStorage } from '@/lib/search-actions/searchActionsStorage'
|
||||
import { selectedWorkspaceStorage } from '@/lib/workspace/workspace-storage'
|
||||
import type { ChatMode } from './chatTypes'
|
||||
import { useChatRefs } from './useChatRefs'
|
||||
import { useNotifyActiveTab } from './useNotifyActiveTab'
|
||||
@@ -142,6 +143,17 @@ export const useChatSession = () => {
|
||||
const workingDirRef = useRef<string | undefined>(undefined)
|
||||
const messagesRef = useRef<UIMessage[]>([])
|
||||
|
||||
useEffect(() => {
|
||||
selectedWorkspaceStorage.getValue().then((folder) => {
|
||||
workingDirRef.current = folder?.path
|
||||
})
|
||||
|
||||
const unwatch = selectedWorkspaceStorage.watch((folder) => {
|
||||
workingDirRef.current = folder?.path
|
||||
})
|
||||
return () => unwatch()
|
||||
}, [])
|
||||
|
||||
useDeepCompareEffect(() => {
|
||||
modeRef.current = mode
|
||||
textToActionRef.current = textToAction
|
||||
@@ -330,7 +342,6 @@ export const useChatSession = () => {
|
||||
const unwatch = searchActionsStorage.watch((storageAction) => {
|
||||
if (storageAction) {
|
||||
setMode(storageAction.mode)
|
||||
workingDirRef.current = storageAction.workingDir
|
||||
sendMessage({ text: storageAction.query, action: storageAction.action })
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,7 +8,6 @@ export interface SearchActionStorage {
|
||||
query: string
|
||||
mode: 'chat' | 'agent'
|
||||
action?: ChatAction
|
||||
workingDir?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
|
||||
Reference in New Issue
Block a user