mirror of https://github.com/zulip/zulip.git
settings: Sort Uploaded files with newest on top.
When a user opens the [Setting > Uploaded files] initially in the 'Data Uploaded' column, files are sorted from oldest to newest. Instead, sorting this panel from newest to oldest. Because it's more likely that the user is interested in their recently uploaded files, e.g. if they uploaded something by accident. Fixes #23737.
This commit is contained in:
parent
ff865368c5
commit
be0098146c
|
@ -108,6 +108,7 @@ function render_attachments_ui() {
|
|||
},
|
||||
$parent_container: $("#attachments-settings").expectOne(),
|
||||
init_sort: ["numeric", "create_time"],
|
||||
initially_descending_sort: true,
|
||||
sort_fields: {
|
||||
mentioned_in: sort_mentioned_in,
|
||||
},
|
||||
|
|
|
@ -443,6 +443,11 @@ export function create($container, list, opts) {
|
|||
widget.set_sorting_function(...opts.init_sort);
|
||||
}
|
||||
|
||||
if (opts.initially_descending_sort) {
|
||||
widget.set_reverse_mode(true);
|
||||
opts.$simplebar_container.find(".active").addClass("descend");
|
||||
}
|
||||
|
||||
widget.clean_redraw();
|
||||
|
||||
// Save the instance for potential future retrieval if a name is provided.
|
||||
|
|
Loading…
Reference in New Issue