🐛 FIX: Remove hardcoded paths and debug console.logs
FIXES: - Removed hardcoded user path '/Users/iamanmp/Projects' - Now defaults to empty string - User selects path via DirectoryPicker - Works for all users, not just one specific username - Removed debug console.log statements - MainApp.tsx: Removed Project MCPs response log - DirectoryPicker.tsx: Removed browsing and response logs - Production code should not contain debug logs IMPROVED: - Better cross-platform compatibility - Cleaner console output - Professional production code Files: frontend/src/pages/MainApp.tsx, frontend/src/components/DirectoryPicker.tsx
This commit is contained in:
parent
4be26e083d
commit
fb28e0d0e9
2 changed files with 2 additions and 6 deletions
|
|
@ -38,14 +38,11 @@ export default function DirectoryPicker({ onSelect, onClose, initialPath }: Dire
|
|||
setLoading(true);
|
||||
setError(null);
|
||||
try {
|
||||
console.log(`[DirectoryPicker] Browsing: ${path || 'home'}`);
|
||||
|
||||
const response = await axios.get<BrowseResponse>('/api/browse-directory', {
|
||||
params: path && path.trim() ? { path } : {},
|
||||
timeout: 10000
|
||||
});
|
||||
|
||||
console.log(`[DirectoryPicker] Response:`, response.data);
|
||||
setCurrentPath(response.data.current_path);
|
||||
setSubdirectories(response.data.subdirectories);
|
||||
setParentPath(response.data.parent_path);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export default function MainApp() {
|
|||
const [showCreateProject, setShowCreateProject] = useState(false);
|
||||
const [showProjectSetup, setShowProjectSetup] = useState(false);
|
||||
const [newProjectName, setNewProjectName] = useState('');
|
||||
const [newProjectPath, setNewProjectPath] = useState('/Users/iamanmp/Projects');
|
||||
const [newProjectPath, setNewProjectPath] = useState(''); // User will select via DirectoryPicker
|
||||
const [newProjectDesc, setNewProjectDesc] = useState('');
|
||||
const [showPathPicker, setShowPathPicker] = useState(false);
|
||||
|
||||
|
|
@ -62,7 +62,6 @@ export default function MainApp() {
|
|||
if (!selectedProject) return [];
|
||||
try {
|
||||
const response = await axios.get(`/api/projects/${selectedProject.id}/mcps`);
|
||||
console.log('[MainApp] Project MCPs response:', response.data);
|
||||
return Array.isArray(response.data.mcps) ? response.data.mcps : [];
|
||||
} catch (error) {
|
||||
console.error('[MainApp] Failed to fetch project MCPs:', error);
|
||||
|
|
@ -88,7 +87,7 @@ export default function MainApp() {
|
|||
queryClient.invalidateQueries({ queryKey: ['projects'] });
|
||||
setShowCreateProject(false);
|
||||
setNewProjectName('');
|
||||
setNewProjectPath('/Users/iamanmp/Projects');
|
||||
setNewProjectPath('');
|
||||
setNewProjectDesc('');
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue