File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11// @ts -check
22
3+ // Reload every 5 minutes (when captcha expires)
4+ // Although this loses user inputs it is better than losing inputs and failing after submit.
5+ setTimeout ( function ( ) {
6+ window . location . reload ( ) ;
7+ } , 5 * 60 * 1000 ) ;
8+
39function $ ( ) {
410 return {
511 response_display : document . querySelector ( '#response_display' ) ,
@@ -92,6 +98,18 @@ $().request_form.addEventListener('submit', (event) => {
9298
9399preselectParatimeFromURL ( ) ;
94100
101+ // Sync paratime selection back to querystring
102+ $ ( ) . paratime . addEventListener ( 'change' , ( ) => {
103+ const url = new URL ( window . location . href ) ;
104+ const selectedValue = $ ( ) . paratime . value ;
105+ if ( selectedValue ) {
106+ url . searchParams . set ( 'paratime' , selectedValue ) ;
107+ } else {
108+ url . searchParams . delete ( 'paratime' ) ;
109+ }
110+ window . history . replaceState ( { } , '' , url ) ;
111+ } ) ;
112+
95113// Add Sapphire to MetaMask
96114$ ( ) . add_sapphire_button . addEventListener ( 'click' , ( ) => {
97115 if ( ! window . ethereum ?. request ) {
You can’t perform that action at this time.
0 commit comments