File tree Expand file tree Collapse file tree
codebenders-dashboard/app/students/[guid] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,7 +106,8 @@ export default function StudentDetailPage() {
106106
107107 useEffect ( ( ) => {
108108 if ( ! guid ) return
109- fetch ( `/api/students/${ encodeURIComponent ( guid ) } /sis-link` )
109+ const controller = new AbortController ( )
110+ fetch ( `/api/students/${ encodeURIComponent ( guid ) } /sis-link` , { signal : controller . signal } )
110111 . then ( r => {
111112 if ( r . status === 403 ) {
112113 setSisStatus ( "hidden" )
@@ -130,7 +131,10 @@ export default function StudentDetailPage() {
130131 setSisStatus ( "unavailable" )
131132 }
132133 } )
133- . catch ( ( ) => setSisStatus ( "hidden" ) )
134+ . catch ( err => {
135+ if ( err . name !== "AbortError" ) setSisStatus ( "hidden" )
136+ } )
137+ return ( ) => controller . abort ( )
134138 } , [ guid ] )
135139
136140 // ─── Loading skeleton ────────────────────────────────────────────────────
You can’t perform that action at this time.
0 commit comments