Skip to content

Commit

Permalink
fix: fix loading contracts using code_id in query params (#1236)
Browse files Browse the repository at this point in the history
* chore: fix loading codes with query params

* chore: fix add addresses in upload contract

---------

Co-authored-by: chary <57086313+charymalloju@users.noreply.github.com>
  • Loading branch information
Hemanthghs and charymalloju authored May 21, 2024
1 parent 0f372d0 commit 673123a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ const PageContracts = ({ chainName }: { chainName: string }) => {
const [selectedTab, setSelectedTab] = useState('Contracts');

const paramContractAddress = useSearchParams().get('contract');
const paramsCodeId = useSearchParams().get('code_id');

useEffect(() => {
if (paramContractAddress?.length) {
setSelectedTab('Contracts');
}
}, [paramContractAddress]);

useEffect(() => {
if (paramsCodeId?.length) {
setSelectedTab('All Contracts');
}
}, [paramsCodeId]);

return (
<div className="h-screen flex flex-col p-6 px-10 gap-10">
<div className="flex flex-col gap-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AddAddresses = (props: AddAddressesI) => {
const input = e.target.value;
const newAddresses = addresses.map((value, key) => {
if (index === key) {
input.trim();
return input.trim();
}
return value;
});
Expand Down

0 comments on commit 673123a

Please sign in to comment.