@@ -115,18 +115,17 @@ export default function SearchPage() {
115115 try {
116116 const analytics = await githubAPIClient . getUserAnalytics ( userParam ) ;
117117 if ( analytics ) {
118- // Convert GitHubUserDetailed to the expected profile format
119118 const convertedAnalytics : UserAnalytics = {
120119 profile : analytics . profile ? {
121120 avatar_url : analytics . profile . avatar_url ,
122121 login : analytics . profile . login ,
123122 type : analytics . profile . type ,
124- bio : analytics . profile . bio ,
123+ bio : analytics . profile . bio ?? null ,
125124 public_repos : analytics . profile . public_repos ,
126125 followers : analytics . profile . followers ,
127126 following : analytics . profile . following ,
128- location : analytics . profile . location ,
129- company : analytics . profile . company ,
127+ location : analytics . profile . location ?? null ,
128+ company : analytics . profile . company ?? null ,
130129 html_url : analytics . profile . html_url
131130 } : undefined ,
132131 overview : analytics . overview ,
@@ -174,7 +173,6 @@ export default function SearchPage() {
174173 [ ]
175174 ) ;
176175
177- // Scroll spy effect - ONLY h2 titles matter
178176 useEffect ( ( ) => {
179177 const handleScroll = throttle ( ( ) => {
180178 const sectionIds = [ 'overview' , 'behavior' , 'star' , 'code' , 'code-review' , 'issue' , 'monthly-stats' , 'contribution-activities' ] ;
@@ -216,33 +214,10 @@ export default function SearchPage() {
216214 return ( ) => window . removeEventListener ( "scroll" , handleScroll ) ;
217215 } , [ activeSection , throttle ] ) ;
218216
219- const loadUserAnalytics = useCallback ( async ( ) => {
220- if ( ! userParam ) return ;
221- const requestedUser = userParam ;
222-
223- setLoadingAnalytics ( true ) ;
224- try {
225- const analytics = await githubAPIClient . getUserAnalytics ( requestedUser ) ;
226- // Ignore if param changed while awaiting
227- if ( requestedUser !== userParam ) return ;
228- setUserAnalytics ( analytics ) ;
229- } catch {
230- // Fallback to null if API fails
231- if ( requestedUser !== userParam ) return ;
232- setUserAnalytics ( null ) ;
233- } finally {
234- if ( requestedUser === userParam ) {
235- setLoadingAnalytics ( false ) ;
236- }
237- }
238- } , [ userParam ] ) ;
239-
240217 useEffect ( ( ) => {
241218 if ( userParam || repoParam ) {
242219 const query = userParam || repoParam || "" ;
243220 const type = userParam ? "users" : "repos" ;
244-
245- // Clear previous state when switching users
246221 setUserAnalytics ( null ) ;
247222 setSearchResults ( {
248223 repos : [ ] ,
@@ -256,7 +231,6 @@ export default function SearchPage() {
256231 performSearch ( query , type ) ;
257232 setHasSearched ( true ) ;
258233
259- // If searching for a user, load analytics
260234 if ( userParam ) {
261235 loadUserAnalytics ( ) ;
262236 }
0 commit comments