mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-13 05:37:44 +02:00
Fix retry on timeout for AJAX requests
This commit is contained in:
@ -9,7 +9,6 @@ function mark_watched(target) {
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('POST', url, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send('csrf_token=' + watched_data.csrf_token);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
@ -18,6 +17,8 @@ function mark_watched(target) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=' + watched_data.csrf_token);
|
||||
}
|
||||
|
||||
function mark_unwatched(target) {
|
||||
@ -33,7 +34,6 @@ function mark_unwatched(target) {
|
||||
xhr.timeout = 20000;
|
||||
xhr.open('POST', url, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send('csrf_token=' + watched_data.csrf_token);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
@ -43,4 +43,6 @@ function mark_unwatched(target) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhr.send('csrf_token=' + watched_data.csrf_token);
|
||||
}
|
Reference in New Issue
Block a user