File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ function base64url_decode(input) {
289289
290290{ % if experimental - % }
291291/* Decrypt part of the search index and refresh it for search engine */
292- { % if webcrypto % } async { % endif % } function decrypt_search ( keys ) {
292+ { % if webcrypto % } async { % endif % } function decrypt_search ( keys , retry = true ) {
293293 let sessionIndex = sessionStorage . getItem ( 'encryptcontent-index' ) ;
294294 let could_decrypt = false ;
295295 if ( sessionIndex ) {
@@ -323,6 +323,10 @@ function base64url_decode(input) {
323323 window . location . reload ( ) ;
324324 }
325325 }
326+ } else if ( retry ) {
327+ setTimeout ( ( ) => { //retry after one second if 'encryptcontent-index' not available yet
328+ decrypt_search ( keys , false ) ;
329+ } , 1000 ) ;
326330 }
327331} ;
328332{ % - endif % }
You can’t perform that action at this time.
0 commit comments