Fix duplicate file list requests

This commit is contained in:
2024-10-06 12:58:43 +02:00
parent cf4378edf6
commit 9bad569ca3
3 changed files with 6 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
import { useState, useEffect, useCallback } from 'react';
import { fetchFileList } from '../services/api';
export const useFileList = (gitEnabled) => {
export const useFileList = () => {
const [files, setFiles] = useState([]);
const loadFileList = useCallback(async () => {
@@ -17,9 +17,5 @@ export const useFileList = (gitEnabled) => {
}
}, []);
useEffect(() => {
loadFileList();
}, [gitEnabled]);
return { files, loadFileList };
};