fix multiple render page
This commit is contained in:
@@ -77,7 +77,9 @@ const Index = () => {
|
|||||||
const handleRenameFile = useCallback(
|
const handleRenameFile = useCallback(
|
||||||
(file: FileProps, newName: string) => {
|
(file: FileProps, newName: string) => {
|
||||||
if (ptero) {
|
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);
|
setRenamePopup(initialRenamePopupState);
|
||||||
},
|
},
|
||||||
@@ -143,7 +145,7 @@ const Index = () => {
|
|||||||
<div className="w-10">
|
<div className="w-10">
|
||||||
{file.attributes.is_file ? <DocumentIcon /> : <FolderIcon />}
|
{file.attributes.is_file ? <DocumentIcon /> : <FolderIcon />}
|
||||||
</div>
|
</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">
|
<div className="w-48 text-right">
|
||||||
{file.attributes.is_file ? file.attributes.size + " bytes" : ""}
|
{file.attributes.is_file ? file.attributes.size + " bytes" : ""}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user