From eb497c7ccbce94a14b9ed6b9c36b3317b818a358 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 29 Sep 2024 21:40:04 +0200 Subject: [PATCH] Fix infinite file list load bug --- frontend/src/hooks/useFileManagement.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/useFileManagement.js b/frontend/src/hooks/useFileManagement.js index aa38829..c94eebe 100644 --- a/frontend/src/hooks/useFileManagement.js +++ b/frontend/src/hooks/useFileManagement.js @@ -46,12 +46,15 @@ const useFileManagement = (gitEnabled = false) => { useEffect(() => { const initializeFileSystem = async () => { - await pullLatestChanges(); - await loadFileList(); + if (gitEnabled) { + await pullLatestChanges(); + } else { + await loadFileList(); + } }; initializeFileSystem(); - }, [pullLatestChanges, loadFileList]); + }, [gitEnabled]); const handleFileSelect = async (filePath) => { if (hasUnsavedChanges) {