File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 485485 expposeGlobalMethods ( id )
486486 } )
487487 }
488- function updateOnlineParam ( target_url , newValue ) {
488+ function updateParam ( target_url , key , newValue ) {
489489 try {
490490 const url = new URL ( target_url )
491491 const [ hashPath , hashQuery ] = url . hash . split ( '?' )
495495 } else {
496496 searchParams = url . searchParams
497497 }
498- searchParams . set ( 'online' , newValue )
498+ searchParams . set ( key , newValue )
499499 if ( hashQuery ) {
500500 url . hash = `${ hashPath } ?${ searchParams . toString ( ) } `
501501 } else {
533533 const iframe = document . getElementById ( `sqlbot-assistant-chat-iframe-${ id } ` )
534534 if ( iframe ) {
535535 const url = iframe . src
536- let new_url = ` ${ url } &t= ${ Date . now ( ) } `
536+ let new_url = updateParam ( url , 't' , Date . now ( ) )
537537 if ( online != null ) {
538- new_url = updateOnlineParam ( new_url , online )
538+ new_url = updateParam ( new_url , 'online' , online )
539539 }
540- iframe . src = new_url
540+ iframe . src = 'about:blank'
541+ setTimeout ( ( ) => {
542+ iframe . src = new_url
543+ } , 500 )
541544 }
542545 }
543546 }
You can’t perform that action at this time.
0 commit comments