mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-02 06:26:27 -04:00
Fix retry on timeout for AJAX requests
This commit is contained in:
parent
a3164177f8
commit
552f616305
9 changed files with 110 additions and 53 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue