Skip to content

Commit

Permalink
[search] Fix address lookup if no owned objects (#900)
Browse files Browse the repository at this point in the history
Resolves #899
Resolves #856
  • Loading branch information
gregnazario authored Nov 5, 2024
1 parent 8496bc8 commit 0d96a25
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/pages/layout/Search/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,15 @@ export default function HeaderSearch() {
const anyObjectsPromise = state.sdk_v2_client
.getAccountOwnedObjects({accountAddress: address})
.then(
() => {
return {
label: `Address ${address}`,
to: `/account/${address}`,
};
(output) => {
if (output.length > 0) {
return {
label: `Address ${address}`,
to: `/account/${address}`,
};
} else {
return null;
}
},
() => {
// It has no coins
Expand Down

0 comments on commit 0d96a25

Please sign in to comment.