Skip to content

Commit

Permalink
adapt missed optional use
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocrime committed Sep 4, 2024
1 parent 79bc730 commit c2e7933
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/minifront/src/fetchers/balances/by-priority-score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const sortByPriorityScore = (a: BalancesResponse, b: BalancesResponse) =>
};

export const sortByPriorityScoreAndAccountIndex = (a: BalancesResponse, b: BalancesResponse) => {
const aIndex = getAddressIndex.optional()(a)?.account ?? Infinity;
const bIndex = getAddressIndex.optional()(b)?.account ?? Infinity;
const aIndex = getAddressIndex.optional(a)?.account ?? Infinity;
const bIndex = getAddressIndex.optional(b)?.account ?? Infinity;

if (aIndex === bIndex) {
return sortByPriorityScore(a, b);
Expand Down
2 changes: 1 addition & 1 deletion docs/adrs/001-getters.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If we want to allow `undefined`, we can add a call to `.optional()`:
required because we called `.optional()`. Otherwise, TypeScript would have
guaranteed that the return value of `getAddressIndex()` was an actual
`AddressIndex`. */}
{getAddressIndex.optional()(addressView)?.account}
{getAddressIndex.optional(addressView)?.account}
</span>
</div>
```
Expand Down

0 comments on commit c2e7933

Please sign in to comment.