fix multiple render page

This commit is contained in:
2024-08-31 19:15:07 +00:00
parent a067690610
commit 40a5e22aec

View File

@@ -77,7 +77,9 @@ const Index = () => {
const handleRenameFile = useCallback(
(file: FileProps, newName: string) => {
if (ptero) {
ptero.files.rename(file, newName);
ptero.files.rename(file, newName).then(() => {
ptero.files.fetchFiles().then(setFileList); // Pobierz zaktualizowaną listę plików po zmianie nazwy
});
}
setRenamePopup(initialRenamePopupState);
},
@@ -143,7 +145,7 @@ const Index = () => {
<div className="w-10">
{file.attributes.is_file ? <DocumentIcon /> : <FolderIcon />}
</div>
<div className="w-48 text-left">{file.attributes.name}</div>
<div className="w-64 text-left">{file.attributes.name}</div>
<div className="w-48 text-right">
{file.attributes.is_file ? file.attributes.size + " bytes" : ""}
</div>