@@ -71,7 +71,10 @@ export default function AnalyzePage() {
7171 setIsLoading ( false ) ;
7272 } else {
7373 console . warn ( "No bias or data found. Redirecting..." ) ;
74- router . push ( "/analyze" ) ;
74+ if ( ! isRedirecting . current ) {
75+ isRedirecting . current = true ;
76+ router . push ( "/analyze" ) ; // 🔹 You can also add a toast here
77+ }
7578 }
7679 } , [ router ] ) ;
7780
@@ -92,15 +95,15 @@ export default function AnalyzePage() {
9295 // 🔹 Step 2: Append LLM’s response
9396 setMessages ( [ ...newMessages , { role : "assistant" , content : data . answer } ] ) ;
9497 }
95-
96- if ( isLoading || ! analysisData || ! biasScore ) {
98+ if ( isLoading ) {
9799 return (
98100 < div className = "flex items-center justify-center h-screen" >
99101 < div className = "text-muted-foreground" > Analyzing content...</ div >
100102 </ div >
101103 ) ;
102104 }
103105
106+
104107 const {
105108 cleaned_text,
106109 facts = [ ] ,
@@ -109,6 +112,10 @@ export default function AnalyzePage() {
109112 score,
110113 } = analysisData ;
111114
115+
116+
117+
118+
112119 return (
113120 < div className = "flex flex-col min-h-screen" >
114121 { /* Header omitted for brevity */ }
@@ -137,7 +144,7 @@ export default function AnalyzePage() {
137144 < div className = "lg:col-span-2" >
138145 < Tabs value = { activeTab } onValueChange = { setActiveTab } >
139146 < TabsList >
140- < TabsTrigger value = "summary" > Summary </ TabsTrigger >
147+ < TabsTrigger value = "summary" > Article </ TabsTrigger >
141148 < TabsTrigger value = "perspectives" > Perspective</ TabsTrigger >
142149 < TabsTrigger value = "facts" > Fact Check</ TabsTrigger >
143150 </ TabsList >
0 commit comments