diff --git a/packages/dapp/src/components/CampaignsDisplay/index.tsx b/packages/dapp/src/components/CampaignsDisplay/index.tsx index 509d59df4..e9f8f231f 100644 --- a/packages/dapp/src/components/CampaignsDisplay/index.tsx +++ b/packages/dapp/src/components/CampaignsDisplay/index.tsx @@ -1,6 +1,5 @@ 'use client'; -import React from 'react'; import { CampaignDisplay } from './CampaignDisplay'; import { useCampaigns } from '@/hooks'; import { Spinner } from '@nextui-org/react'; diff --git a/packages/dapp/src/hooks/useCampaignClaims.ts b/packages/dapp/src/hooks/useCampaignClaims.ts index b6c1bf183..a01d09741 100644 --- a/packages/dapp/src/hooks/useCampaignClaims.ts +++ b/packages/dapp/src/hooks/useCampaignClaims.ts @@ -18,11 +18,12 @@ export type Campaigns = Campaign[]; export const useCampaignClaims = (token: string | null) => { return useQuery({ queryKey: ['claims'], + enabled: !!token, queryFn: async () => { const res = await fetch('/api/campaigns/claims', { headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${token}`, + ...(token && { Authorization: `Bearer ${token}` }), }, cache: 'no-store', });