File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ function a(){
399399 _editor . setMode ( 'view' ) ;
400400 IndexedDBOperation . do ( { operation : 'addReplayToStorage' , data : _editor . getText ( ) } ) ;
401401 GitHubApi . fetch ( 'search/repositories?q=topic:AI-Tournaments+topic:AI-Tournaments-Replay+topic:' + _replayData . body . arena . full_name . replace ( '/' , '--' ) ) . then ( response => response . json ( ) ) . then ( response => {
402- const officialUrl = 'https://ai-tournaments.github.io/ ' ; // TODO: 👇 Either only allow absolute URL:s or calculate arena origin.
402+ const officialUrl = 'https://ai-tournaments.github.io' ; // TODO: 👇 Either only allow absolute URL:s or calculate arena origin.
403403 document . getElementById ( 'default-option' ) . value = ( _replayData . header . defaultReplay [ 0 ] === '/' ?officialUrl :'' ) + _replayData . header . defaultReplay ;
404404 response . items . forEach ( repo => {
405405 if ( repo . has_pages ) {
@@ -419,8 +419,8 @@ function a(){
419419 options . sort ( function ( a , b ) {
420420 if ( b . id === 'default-option' ) { return 1 ; }
421421
422- let aOfficial = a . value . startsWith ( officialUrl ) ;
423- let bOfficial = b . value . startsWith ( officialUrl ) ;
422+ let aOfficial = a . value . startsWith ( officialUrl + '/' ) ;
423+ let bOfficial = b . value . startsWith ( officialUrl + '/' ) ;
424424 if ( aOfficial ? ! bOfficial : bOfficial ) { return 1 ; }
425425
426426 if ( parseFloat ( a . dataset . stars ) < parseFloat ( b . dataset . stars ) ) { return - 1 ; }
You can’t perform that action at this time.
0 commit comments