File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ export default function QEInputButton({ cifText }) {
1010 return ;
1111 }
1212
13+ // Open immediately to avoid popup blocking stuff...
14+ const popup = window . open ( "" , "_blank" ) ;
15+
1316 try {
1417 const formData = new FormData ( ) ;
1518 formData . append ( "fileformat" , "cif-ase" ) ;
@@ -31,12 +34,15 @@ export default function QEInputButton({ cifText }) {
3134 const json = await response . json ( ) ;
3235
3336 if ( json . redirect ) {
34- window . open ( `${ DOMAIN } ${ json . redirect } ` , "_blank" ) ;
37+ // channel the redirect into the popup window...
38+ popup . location = `${ DOMAIN } ${ json . redirect } ` ;
3539 } else {
40+ popup . close ( ) ;
3641 alert ( "Unexpected response from server" ) ;
3742 }
3843 } catch ( err ) {
3944 console . error ( err ) ;
45+ popup . close ( ) ;
4046 alert ( "Failed to upload structure." ) ;
4147 }
4248 } ;
Original file line number Diff line number Diff line change 1+ {
2+ "status" : " failed" ,
3+ "failedTests" : []
4+ }
You can’t perform that action at this time.
0 commit comments