File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -420,15 +420,8 @@ <h1>Litros</br>Library Tracker for OneScript</h1>
420420 } else if ( data . error ) {
421421 throw new Error ( data . error ) ;
422422 } else {
423- resultsDiv . innerHTML = `
424- <div class="empty">
425- ${
426- data . message
427- ? `<h3>${ data . message . replace ( / \. ( \s | $ ) / g, ".</br>" ) } </h3>`
428- : `<h3>Репозитории не найдены</strong></h3>`
429- }
430- </div>
431- ` ;
423+ displayBadge ( packageName ) ;
424+ displayNotFound ( data . message ) ;
432425 }
433426 } catch ( error ) {
434427 resultsDiv . innerHTML = `
@@ -559,6 +552,19 @@ <h2>Используется в репозиториях GitHub: ${allRepositori
559552 displayResults ( ) ;
560553 }
561554
555+ function displayNotFound ( message ) {
556+ const resultsDiv = document . getElementById ( 'results' ) ;
557+ resultsDiv . innerHTML = `
558+ <div class="empty">
559+ ${
560+ message
561+ ? `<h3>${ message . replace ( / \. ( \s | $ ) / g, ".</br>" ) } </h3>`
562+ : `<h3>Репозитории не найдены</strong></h3>`
563+ }
564+ </div>
565+ ` ;
566+ }
567+
562568 document . getElementById ( 'packageInput' ) . addEventListener ( 'keypress' , function ( e ) {
563569 if ( e . key === 'Enter' ) {
564570 searchDependents ( ) ;
You can’t perform that action at this time.
0 commit comments