Skip to content

Commit 8be1436

Browse files
fix: x
1 parent ebb9a56 commit 8be1436

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

client/src/pages/home.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useState, useEffect } from "react";
22
import { useMutation } from "@tanstack/react-query";
3-
import { useSearchParams } from "react-router-dom";
43
import { apiRequest } from "@/lib/queryClient";
54
import { Header } from "@/components/header-new";
65
import { Footer } from "@/components/footer";
@@ -36,7 +35,6 @@ import { SocialSentimentCard } from "@/components/social-sentiment-card";
3635

3736
export default function Home() {
3837
const { toast } = useToast();
39-
const [searchParams] = useSearchParams();
4038
const [analysis, setAnalysis] = useState<TokenAnalysisResponse | null>(null);
4139
const [hasAutoAnalyzed, setHasAutoAnalyzed] = useState(false);
4240

@@ -74,12 +72,13 @@ export default function Home() {
7472

7573
// Auto-analyze if token query param is present (from Analytics page "Analyze" buttons)
7674
useEffect(() => {
75+
const searchParams = new URLSearchParams(window.location.search);
7776
const tokenFromUrl = searchParams.get('token');
7877
if (tokenFromUrl && !hasAutoAnalyzed && tokenFromUrl.length >= 32 && tokenFromUrl.length <= 44) {
7978
setHasAutoAnalyzed(true);
8079
mutation.mutate(tokenFromUrl);
8180
}
82-
}, [searchParams, hasAutoAnalyzed]);
81+
}, [hasAutoAnalyzed]);
8382

8483
const getRiskColor = (score: number) => {
8584
if (score >= 80) return "text-red-500";

0 commit comments

Comments
 (0)