fix multiple render page
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user