Skip to content

Commit fcb8c11

Browse files
committed
Bug fix: update rootFolder at Go
1 parent dc6198f commit fcb8c11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

smoosense-gui/src/components/home/HomeInfoSection.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Input } from '@/components/ui/input'
77
import { ExternalLink, Play, Download, AlertCircle } from 'lucide-react'
88
import { API_PREFIX } from '@/lib/utils/urlUtils'
99
import { debounce } from 'lodash'
10+
import { useAppDispatch } from '@/lib/hooks'
11+
import { setRootFolder } from '@/lib/features/ui/uiSlice'
1012

1113
type PathType = 's3' | 'local' | 'invalid' | 'empty'
1214

@@ -23,6 +25,7 @@ function getPathType(path: string, isLocal: boolean): PathType {
2325

2426
export default function HomeInfoSection() {
2527
const router = useRouter()
28+
const dispatch = useAppDispatch()
2629
const [folderPath, setFolderPath] = useState('')
2730
const [isLocal, setIsLocal] = useState(false)
2831
const [suggestions, setSuggestions] = useState<string[]>([])
@@ -88,6 +91,7 @@ export default function HomeInfoSection() {
8891

8992
const handleGoToFolder = () => {
9093
if (folderPath.trim()) {
94+
dispatch(setRootFolder(folderPath.trim()))
9195
router.push(`/FolderBrowser?rootFolder=${encodeURIComponent(folderPath.trim())}`)
9296
}
9397
}

0 commit comments

Comments
 (0)