Display DNS deployment URLs in overview section #21

Merged
nabarun merged 6 commits from iv-disable-deploy-button into main 2024-10-30 13:11:05 +00:00
3 changed files with 29 additions and 27 deletions
Showing only changes of commit 93afc0be7a - Show all commits

View File

@ -538,7 +538,9 @@ const Configure = () => {
<Button <Button
{...buttonSize} {...buttonSize}
type="submit" type="submit"
disabled={isLoading || isPaymentLoading} disabled={
isLoading || isPaymentLoading || !selectedAccount
}
rightIcon={ rightIcon={
isLoading || isPaymentLoading ? ( isLoading || isPaymentLoading ? (
<LoadingIcon className="animate-spin" /> <LoadingIcon className="animate-spin" />

View File

@ -42,31 +42,31 @@ export const AuctionCard = ({ project }: { project: Project }) => {
<LoadingIcon className="animate-spin" /> <LoadingIcon className="animate-spin" />
); );
const checkAuctionStatus = useCallback(async () => { const checkAuctionStatus = useCallback(async () => {
const result = await client.getAuctionData(project.auctionId); const result = await client.getAuctionData(project.auctionId);
setAuctionStatus(result.status); setAuctionStatus(result.status);
setAuctionDetails(result); setAuctionDetails(result);
}, [project.auctionId, project.deployers, project.fundsReleased]); }, [project.auctionId, project.deployers, project.fundsReleased]);
const fetchUpdatedProject = useCallback(async () => { const fetchUpdatedProject = useCallback(async () => {
const updatedProject = await client.getProject(project.id); const updatedProject = await client.getProject(project.id);
setDeployers(updatedProject.project!.deployers!); setDeployers(updatedProject.project!.deployers!);
setFundsStatus(updatedProject.project!.fundsReleased!); setFundsStatus(updatedProject.project!.fundsReleased!);
}, [project.id]); }, [project.id]);
const fetchData = useCallback(async () => { const fetchData = useCallback(async () => {
await Promise.all([checkAuctionStatus(), fetchUpdatedProject()]); await Promise.all([checkAuctionStatus(), fetchUpdatedProject()]);
}, [checkAuctionStatus, fetchUpdatedProject]); }, [checkAuctionStatus, fetchUpdatedProject]);
useEffect(() => { useEffect(() => {
fetchData();
const timerId = setInterval(() => {
fetchData(); fetchData();
}, WAIT_DURATION);
const timerId = setInterval(() => { return () => clearInterval(timerId);
fetchData(); }, [fetchData]);
}, WAIT_DURATION);
return () => clearInterval(timerId);
}, [fetchData]);
const renderAuctionStatus = useCallback( const renderAuctionStatus = useCallback(
() => ( () => (

View File

@ -10,7 +10,6 @@ import {
import SignClient from '@walletconnect/sign-client'; import SignClient from '@walletconnect/sign-client';
import { getSdkError } from '@walletconnect/utils'; import { getSdkError } from '@walletconnect/utils';
import { SessionTypes } from '@walletconnect/types'; import { SessionTypes } from '@walletconnect/types';
import { StargateClient } from '@cosmjs/stargate';
import { walletConnectModal } from '../utils/web3modal'; import { walletConnectModal } from '../utils/web3modal';
import { import {
@ -46,10 +45,6 @@ export const WalletConnectClientProvider = ({
const isSignClientInitializing = useRef<boolean>(false); const isSignClientInitializing = useRef<boolean>(false);
const createCosmosClient = useCallback(async (endpoint: string) => {
return await StargateClient.connect(endpoint);
}, []);
const onSessionConnect = useCallback(async (session: SessionTypes.Struct) => { const onSessionConnect = useCallback(async (session: SessionTypes.Struct) => {
setSession(session); setSession(session);
}, []); }, []);
@ -166,6 +161,11 @@ export const WalletConnectClientProvider = ({
if (!session) { if (!session) {
return; return;
} }
if (!session.namespaces['cosmos']) {
console.log('Accounts for cosmos namespace not found');
return;
}
const cosmosAddresses = session.namespaces['cosmos'].accounts; const cosmosAddresses = session.namespaces['cosmos'].accounts;
const cosmosAccounts = cosmosAddresses.map((address) => ({ const cosmosAccounts = cosmosAddresses.map((address) => ({
@ -178,7 +178,7 @@ export const WalletConnectClientProvider = ({
}; };
populateAccounts(); populateAccounts();
}, [session, createCosmosClient]); }, [session]);
useEffect(() => { useEffect(() => {
if (!signClient) { if (!signClient) {