mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
fix: sorting by a date column shows the oldest entries first (#35279)
Switching the sort to a date column put the oldest entries first in the admin user list, a group's member list, feedbacks, the archived, shared and per-user chat lists, the file manager and the file browser, so the entries people usually look for ended up at the end. Date columns now sort newest first when picked, like the workspace lists already do. Clicking again still flips the order. Fixes #35278
This commit is contained in:
1 parent
9f7c08ff7f
commit
8713ff860b
7 files changed
+7
-7
No files matched your search
@@ -53,7 +53,7 @@
|
||||
direction = direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
orderBy = key;
|
||||
direction = 'asc';
|
||||
direction = key === 'updated_at' ? 'desc' : 'asc';
|
||||
}
|
||||
page = 1;
|
||||
};
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
direction = direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
orderBy = key;
|
||||
direction = 'asc';
|
||||
direction = key === 'last_active_at' ? 'desc' : 'asc';
|
||||
}
|
||||
page = 1;
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
direction = direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
orderBy = key;
|
||||
direction = 'asc';
|
||||
direction = key === 'created_at' || key === 'last_active_at' ? 'desc' : 'asc';
|
||||
}
|
||||
page = 1;
|
||||
};
|
||||
|
||||
@@ -569,7 +569,7 @@
|
||||
sortAsc = !sortAsc;
|
||||
} else {
|
||||
sortBy = mode;
|
||||
sortAsc = true;
|
||||
sortAsc = mode !== 'date' && mode !== 'created';
|
||||
}
|
||||
void refreshBrowser();
|
||||
};
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
direction = direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
orderBy = key;
|
||||
direction = 'asc';
|
||||
direction = key === 'updated_at' ? 'desc' : 'asc';
|
||||
}
|
||||
|
||||
await loadChats();
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
direction = direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
orderBy = key;
|
||||
direction = 'asc';
|
||||
direction = key === 'updated_at' ? 'desc' : 'asc';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@
|
||||
disabled={busy}
|
||||
class="hidden items-center justify-end gap-1 hover:text-base-700 dark:hover:text-base-200 sm:flex"
|
||||
on:click={() => {
|
||||
direction = orderBy === 'created_at' && direction === 'asc' ? 'desc' : 'asc';
|
||||
direction = orderBy === 'created_at' && direction === 'desc' ? 'asc' : 'desc';
|
||||
orderBy = 'created_at';
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user