Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/web/src/app/api/dao/[daoId]/auctions/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function GET(_request: Request, { params }: { params: Promise<{ dao
try {
const { daoId } = await params;
const config = await getDaoNetworkConfigById(daoId);
if (!config.auctionContractId || config.auctionEnabled === false) {
if (!config.auctionContractId) {
return NextResponse.json({ message: 'Auctions are disabled for this DAO.' }, { status: 404 });
}

Expand All @@ -34,13 +34,14 @@ export async function GET(_request: Request, { params }: { params: Promise<{ dao
const auctionTx = await client.get_auction();
const auction = jsonValue(auctionTx.result) as { token_id?: string } | null;
const paused = Boolean(pausedTx.result);
const auctionEnabled = config.auctionEnabled !== false || !paused;
if (!auction || typeof auction.token_id === 'undefined') {
// No auction token exists yet. Determine if we've never launched or if we paused after launching.
// If there's auction history, we've been paused. Otherwise, we've never launched.
return NextResponse.json({
status: paused && history.length > 0 ? 'paused' : 'not-launched',
auction: null,
auctionEnabled: true,
auctionEnabled,
paused,
config: jsonValue(configTx.result),
history
Expand All @@ -51,7 +52,7 @@ export async function GET(_request: Request, { params }: { params: Promise<{ dao
jsonValue({
status: paused ? 'paused' : 'active',
auction,
auctionEnabled: true,
auctionEnabled,
config: configTx.result,
paused,
bids,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import {
} from '@/lib/create-dao-schema';
import { getDeploymentConfig, isDeploymentConfigured } from '@/lib/deployment-config';
import { useDaoDeployment } from '@/lib/use-dao-deployment';
import { useAuthSessionStore } from '@/stores/auth-session-store';
import { useCreateDaoStore } from '@/stores/create-dao-store';
import { useDaoSessionStore } from '@/stores/dao-session-store';

type SectionStatus = 'complete' | 'active' | 'error' | 'pending';

Expand Down Expand Up @@ -175,7 +175,7 @@ function AccordionSection({

export default function CreateDaoPage() {
const router = useRouter();
const session = useDaoSessionStore();
const session = useAuthSessionStore();
const sectionRefs = useRef<Partial<Record<CreateDaoSection, HTMLElement>>>({});

const basicInfo = useCreateDaoStore((state) => state.basicInfo);
Expand Down
Loading