Sort plugin mod file list by nexus_file_id

This commit is contained in:
Tyler Hallada 2022-03-15 22:50:51 -04:00
parent 0616a92bbc
commit f33fd3b49c
3 changed files with 3 additions and 2 deletions

View File

@ -256,7 +256,7 @@ const Map: React.FC = () => {
requestAnimationFrame(() => {
if (map.current) map.current.resize();
});
}, [map]);
}, [map, dispatch]);
const clearSelectedMod = useCallback(() => {
requestAnimationFrame(() => {

View File

@ -98,6 +98,7 @@ const PluginModList: React.FC<Props> = ({ mods, files, counts }) => {
<ul className={styles["file-list"]}>
{files
.filter((file) => file.mod_id === mod.id)
.sort((a, b) => b.nexus_file_id - a.nexus_file_id)
.map((file) => (
<li key={file.id}>
<div>

View File

@ -53,7 +53,7 @@ export interface File {
version?: string;
mod_version?: string;
size: number;
uploaded_at?: Date;
uploaded_at?: number;
has_download_link: boolean;
updated_at: Date;
created_at: Date;