Explorer: Sort block program ids in filter dropdown (#22674)

This commit is contained in:
Justin Starry 2022-01-22 13:09:58 +08:00 committed by GitHub
parent 88bf3c7063
commit 477cb539d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -249,7 +249,13 @@ const FilterDropdown = ({
filterOptions.push({ name, programId, transactionCount });
});
filterOptions.sort();
filterOptions.sort((a, b) => {
if (a.transactionCount !== b.transactionCount) {
return b.transactionCount - a.transactionCount;
} else {
return b.name > a.name ? -1 : 1;
}
});
return (
<div className="dropdown me-2">