Skip to content

Commit

Permalink
update contract sort order in numberic way (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Jan 16, 2025
1 parent 0dc3742 commit 992fa53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/nextjs/app/debug/_components/DebugContracts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const selectedContractStorageKey = "scaffoldEth2.selectedContract";

export function DebugContracts() {
const contractsData = useAllContracts();
const contractNames = useMemo(() => Object.keys(contractsData) as ContractName[], [contractsData]);
const contractNames = useMemo(
() =>
Object.keys(contractsData).sort((a, b) => {
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" });
}) as ContractName[],
[contractsData],
);

const [selectedContract, setSelectedContract] = useSessionStorage<ContractName>(
selectedContractStorageKey,
Expand Down

0 comments on commit 992fa53

Please sign in to comment.