Fix directory switcher not working in active chat sessions and file browser not defaulting to current session directory path (#3791)
This commit is contained in:
@@ -1239,7 +1239,7 @@ export default function ChatInput({
|
||||
{/* Secondary actions and controls row below input */}
|
||||
<div className="flex flex-row items-center gap-1 p-2 relative">
|
||||
{/* Directory path */}
|
||||
<DirSwitcher hasMessages={messages.length > 0} className="mr-0" />
|
||||
<DirSwitcher className="mr-0" />
|
||||
<div className="w-px h-4 bg-border-default mx-2" />
|
||||
|
||||
{/* Attach button */}
|
||||
|
||||
@@ -3,22 +3,14 @@ import { FolderDot } from 'lucide-react';
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/Tooltip';
|
||||
|
||||
interface DirSwitcherProps {
|
||||
hasMessages?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const DirSwitcher: React.FC<DirSwitcherProps> = ({
|
||||
hasMessages = false,
|
||||
className = '',
|
||||
}) => {
|
||||
export const DirSwitcher: React.FC<DirSwitcherProps> = ({ className = '' }) => {
|
||||
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
||||
|
||||
const handleDirectoryChange = async () => {
|
||||
if (hasMessages) {
|
||||
window.electron.directoryChooser();
|
||||
} else {
|
||||
window.electron.directoryChooser(true);
|
||||
}
|
||||
window.electron.directoryChooser(true);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user