Skip to content

Commit

Permalink
Optimize calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolmin committed Jan 17, 2024
1 parent 8cdeec6 commit 0dfc045
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/shared/entities/address/AddressEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ const Content = chakra((props: ContentProps) => {
}
useEffect(() => { // this causes a sort of loading state where the address suddenly switches to up name - needs fix?
(async() => {
if (!props.address.is_contract) {
return;
}
const upData = await getUniversalProfile(props.address.hash, queryClient);
if (upData === undefined) {
return;
Expand All @@ -133,7 +136,7 @@ const Content = chakra((props: ContentProps) => {
setUpName(upData.LSP3Profile.name);
}
})();
}, [ props.address.hash, queryClient ]);
}, [ props, queryClient ]);

const displayedName = upName !== '' ? formattedLuksoName(props.address.hash, upName) : props.address.hash;
return (
Expand Down

0 comments on commit 0dfc045

Please sign in to comment.