Fix infinite file list load bug

This commit is contained in:
2024-09-29 21:40:04 +02:00
parent 5af07a9e35
commit eb497c7ccb

View File

@@ -46,12 +46,15 @@ const useFileManagement = (gitEnabled = false) => {
useEffect(() => { useEffect(() => {
const initializeFileSystem = async () => { const initializeFileSystem = async () => {
await pullLatestChanges(); if (gitEnabled) {
await loadFileList(); await pullLatestChanges();
} else {
await loadFileList();
}
}; };
initializeFileSystem(); initializeFileSystem();
}, [pullLatestChanges, loadFileList]); }, [gitEnabled]);
const handleFileSelect = async (filePath) => { const handleFileSelect = async (filePath) => {
if (hasUnsavedChanges) { if (hasUnsavedChanges) {