fix(server/files): duplicate entry when making a nested folder (#3813)
This commit is contained in:
parent
5f308feb3f
commit
1f3217c3c5
1 changed files with 2 additions and 2 deletions
|
@ -22,8 +22,8 @@ import { FileActionCheckbox } from '@/components/server/files/SelectFileCheckbox
|
||||||
import { hashToPath } from '@/helpers';
|
import { hashToPath } from '@/helpers';
|
||||||
|
|
||||||
const sortFiles = (files: FileObject[]): FileObject[] => {
|
const sortFiles = (files: FileObject[]): FileObject[] => {
|
||||||
return files.sort((a, b) => a.name.localeCompare(b.name))
|
const sortedFiles: FileObject[] = files.sort((a, b) => a.name.localeCompare(b.name)).sort((a, b) => a.isFile === b.isFile ? 0 : (a.isFile ? 1 : -1));
|
||||||
.sort((a, b) => a.isFile === b.isFile ? 0 : (a.isFile ? 1 : -1));
|
return sortedFiles.filter((file, index) => index === 0 || file.name !== sortedFiles[index - 1].name);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
Loading…
Reference in a new issue