Skip to content

Commit

Permalink
Merge branch 'finder' of github.com:django-cms/django-filer into finder
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Dec 2, 2024
2 parents 6c655c9 + 446f480 commit 9ba8fb5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/browser/FileSelectDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const FileSelectDialog = forwardRef((props: any, forwardedRef)=> {
}
}

async function fetchFiles() {
const fetchFiles = useCallback(async () => {
const fetchUrl = (() => {
const params = new URLSearchParams();
if (structure.recursive) {
Expand All @@ -213,13 +213,13 @@ const FileSelectDialog = forwardRef((props: any, forwardedRef)=> {
} else {
console.error(response);
}
}
}, [structure.last_folder, structure.recursive, structure.search_query, structure.offset]);

function handleUpload(folderId, uploadedFiles){
if (structure.last_folder !== folderId)
throw new Error('Folder mismatch');
setUploadedFile(uploadedFiles[0]);
}
};

const selectFile = useCallback(fileInfo => {
props.selectFile(fileInfo);
Expand Down Expand Up @@ -251,6 +251,7 @@ const FileSelectDialog = forwardRef((props: any, forwardedRef)=> {
});
}
setUploadedFile(null);
refreshFilesList();
props.closeDialog();
}

Expand Down

0 comments on commit 9ba8fb5

Please sign in to comment.