Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort assets by priority score #1860

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-carpets-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'minifront': patch
---

Sort assets by priority score
4 changes: 3 additions & 1 deletion apps/minifront/src/fetchers/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { penumbra } from '../penumbra';

export const getAllAssets = async (): Promise<Metadata[]> => {
const responses = await Array.fromAsync(penumbra.service(ViewService).assets({}));
return responses.map(getDenomMetadata);
return responses
.map(getDenomMetadata)
.toSorted((a, b) => Number(b.priorityScore) - Number(a.priorityScore));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: can we also apply this to the groupAndSort.ts file in the UI package?

};

export const getAssetMetadataById = async (assetId: AssetId): Promise<Metadata | undefined> => {
Expand Down
Loading