@@ -47,20 +47,17 @@ function openDB(name = "search-cache", version = 1) {
4747 */
4848async function getFromIDB ( key ) {
4949 const db = await openDB ( ) ;
50- console . log ( `Retrieving from IndexedDB with key: ${ key } ` ) ;
5150
5251 return new Promise ( ( resolve , reject ) => {
5352 const transaction = db . transaction ( "indexes" , "readonly" ) ;
5453 const store = transaction . objectStore ( "indexes" ) ;
5554 const request = store . get ( key ) ;
5655
5756 request . onsuccess = ( ) => {
58- console . log ( "Retrieved from IndexedDB:" , request . result ) ;
5957 resolve ( request . result ) ;
6058 } ;
6159
6260 request . onerror = ( ) => {
63- console . error ( "Failed to retrieve from IndexedDB:" , request . error ) ;
6461 reject ( request . error ) ;
6562 } ;
6663 } ) ;
@@ -74,15 +71,13 @@ async function getFromIDB(key) {
7471 */
7572async function saveToIDB ( key , value ) {
7673 const db = await openDB ( ) ;
77- console . log ( `Saving to IndexedDB with key: ${ key } ` , value ) ;
7874
7975 return new Promise ( ( resolve , reject ) => {
8076 const transaction = db . transaction ( "indexes" , "readwrite" ) ;
8177 const store = transaction . objectStore ( "indexes" ) ;
8278 const request = store . put ( value , key ) ;
8379
8480 request . onsuccess = ( ) => {
85- console . log ( "Saved to IndexedDB successfully" ) ;
8681 resolve ( true ) ;
8782 } ;
8883
@@ -136,8 +131,8 @@ require(["fuse"], function (Fuse) {
136131
137132 if ( ! libData ) {
138133 const libPath = EXTRA_SOURCES [ lib ] ;
139- const libJsonPath = `${ libPath } /_static/search.json` ;
140- const res = await fetch ( libJsonPath ) ;
134+ const url = `${ libPath } /_static/search.json` ;
135+ const res = await fetch ( url ) ;
141136 libData = await res . json ( ) ;
142137 await saveToIDB ( cacheKey , libData ) ;
143138 }
@@ -464,7 +459,6 @@ require(["fuse"], function (Fuse) {
464459 const handleSearchInput = debounce (
465460 ( ) => {
466461 const query = document . getElementById ( "search-input" ) . value . trim ( ) ;
467- console . log ( "Search query:" , query ) ;
468462 if ( query . length > 0 ) {
469463 performSearch ( ) ;
470464 }
0 commit comments