Skip to content

Commit b4fa402

Browse files
committed
Prevent close of window removed or error #5
1 parent e51bf7a commit b4fa402

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flask_fastspring.py

+2
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,10 @@ def milliseconds_to_datetime(m):
260260
window.onbeforeunload = function() {};
261261
window.location.replace("{{ request.url }}");
262262
} else if (xhr.status === 201 || (301 <= xhr.status && xhr.status <= 303)) {
263+
window.onbeforeunload = function() {};
263264
window.location.replace(xhr.getResponseHeader("Location"));
264265
} else {
266+
window.onbeforeunload = function() {};
265267
var message = "ERROR: Could not process order: " + data["reference"];
266268
console.log(message);
267269
alert(message);

0 commit comments

Comments
 (0)