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(() => { requestAnimationFrame(() => {
if (map.current) map.current.resize(); if (map.current) map.current.resize();
}); });
}, [map]); }, [map, dispatch]);
const clearSelectedMod = useCallback(() => { const clearSelectedMod = useCallback(() => {
requestAnimationFrame(() => { requestAnimationFrame(() => {

View File

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

View File

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