mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
This commit is contained in:
parent
47e227047d
commit
1c27444f26
|
|
@ -8,7 +8,7 @@ export type DirectoryEntries = {
|
|||
description?: string;
|
||||
href: string;
|
||||
icon?: string;
|
||||
modified?: Date;
|
||||
modified?: number;
|
||||
size?: number;
|
||||
};
|
||||
|
||||
|
|
@ -89,9 +89,9 @@ const formatSize = (size?: number): string => {
|
|||
return newNumber + (addTrailingZero ? ".0" : "") + units[power];
|
||||
};
|
||||
|
||||
const formatDate = (date?: Date): string =>
|
||||
date
|
||||
? getTZOffsetISOString(date.getTime())
|
||||
const formatDate = (timestamp?: number): string =>
|
||||
timestamp
|
||||
? getTZOffsetISOString(timestamp)
|
||||
.replace("T", " ")
|
||||
.split(".")[0]
|
||||
.slice(0, -3)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import {
|
|||
} from "utils/functions";
|
||||
import {
|
||||
getInfoWithExtension,
|
||||
getModifiedTime,
|
||||
getShortcutInfo,
|
||||
} from "components/system/Files/FileEntry/functions";
|
||||
import { useSession } from "contexts/session";
|
||||
|
|
@ -173,18 +174,18 @@ const Browser: FC<ComponentProcessProps> = ({ id }) => {
|
|||
}
|
||||
}
|
||||
|
||||
const stats = await stat(
|
||||
const filePath =
|
||||
shortcutUrl && (await exists(shortcutUrl))
|
||||
? shortcutUrl
|
||||
: href
|
||||
);
|
||||
: href;
|
||||
const stats = await stat(filePath);
|
||||
const isDir = stats.isDirectory();
|
||||
|
||||
return {
|
||||
description,
|
||||
href: isDir && shortcutUrl ? shortcutUrl : href,
|
||||
icon: isDir ? "folder" : undefined,
|
||||
modified: stats.mtime,
|
||||
modified: getModifiedTime(filePath, stats),
|
||||
size: isDir || shortcutUrl ? undefined : stats.size,
|
||||
};
|
||||
})
|
||||
|
|
@ -229,9 +230,7 @@ const Browser: FC<ComponentProcessProps> = ({ id }) => {
|
|||
}
|
||||
|
||||
if (column === "M") {
|
||||
return sortValue(
|
||||
({ modified }) => modified?.getTime() ?? 0
|
||||
);
|
||||
return sortValue(({ modified }) => modified ?? 0);
|
||||
}
|
||||
|
||||
if (column === "D") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user