File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class GitHubApi{
3636 if ( typeof init . body === 'object' ) {
3737 init . body = JSON . stringify ( init . body ) ;
3838 }
39- return await fetch ( new Request ( 'https://api.github.com/' + path , init ) ) . then ( response => {
39+ return await fetch ( new Request ( 'https://api.github.com/' + path , init ) ) . then ( async response => {
4040 if ( localStorage . getItem ( 'GitHub API debug' ) !== null ) {
4141 let a = path . split ( '/' ) [ 0 ] ;
4242 let reset = localStorage . getItem ( '_GitHub ' + a + ' x-ratelimit-reset' ) ;
@@ -63,11 +63,12 @@ class GitHubApi{
6363 if ( response . status === 200 ) {
6464 return response ;
6565 } else if ( response . status === 401 ) {
66- GitHubApi . logout ( ) ;
6766 if ( accessToken ) {
67+ GitHubApi . logout ( ) ;
6868 throw new Error ( 'Unauthorized GitHub OAuth-Token. Logged out.' ) ;
6969 }
70- return ;
70+ console . error ( 'API call requires authorization. Call dropped.' , path ) ;
71+ return await new Promise ( ( ) => { } ) ;
7172 } else if ( [ 403 , 429 /*Unconfirmed*/ ] . includes ( response . status ) ) {
7273 let timestamp = 1000 * ( parseInt ( response . headers . get ( 'x-ratelimit-reset' ) ) + 1 ) ;
7374 if ( this . isLoggedIn ( ) ) {
Original file line number Diff line number Diff line change 261261 </ style >
262262 < script >
263263 if ( location . href . endsWith ( '?soon=aitournaments.io' ) || location . href . endsWith ( '?soon=ai-tournaments.io' ) ) {
264- //window.location.replace('https://aitournaments .io'); Pending...
264+ //window.location.replace('https://ai-tournaments .io'); Pending...
265265 window . location . replace ( '/' ) ;
266266 }
267267 sessionStorage . setItem ( 'PageLoaded' , Date . now ( ) ) ;
280280 < div id ="header-title-fake "> GitHub.com</ div >
281281 </ div >
282282 < div class ="dropdown ">
283- < a href ="https://github.com/AI-Tournaments /AI-Tournaments.github.io/releases/ " target ="_blank "> Announcements</ a >
283+ < a href ="https://github.com/orgs /AI-Tournaments/discussions/categories/1-announcements " target ="_blank "> Announcements</ a >
284284 < div class ="dropdown-content " id ="announcements-dropdown "> </ div >
285285 </ div >
286286 < div class ="dropdown ">
You can’t perform that action at this time.
0 commit comments