Skip to content

Commit 97fa855

Browse files
committed
test popup change?
1 parent 51a4b9d commit 97fa855

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/components/common/QEInputButton.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
};

test-results/.last-run.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"status": "failed",
3+
"failedTests": []
4+
}

0 commit comments

Comments
 (0)