mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-18 12:14:27 -05:00
default parameters
This commit is contained in:
parent
cdd5a9e935
commit
7450cb1f21
@ -10,7 +10,9 @@ if (subscribe_button.getAttribute('data-type') === 'subscribe') {
|
|||||||
subscribe_button.onclick = unsubscribe;
|
subscribe_button.onclick = unsubscribe;
|
||||||
}
|
}
|
||||||
|
|
||||||
function subscribe(retries = 5) {
|
function subscribe(retries) {
|
||||||
|
if (retries === undefined) retries = 5;
|
||||||
|
|
||||||
if (retries <= 0) {
|
if (retries <= 0) {
|
||||||
console.log('Failed to subscribe.');
|
console.log('Failed to subscribe.');
|
||||||
return;
|
return;
|
||||||
@ -50,7 +52,10 @@ function subscribe(retries = 5) {
|
|||||||
xhr.send('csrf_token=' + subscribe_data.csrf_token);
|
xhr.send('csrf_token=' + subscribe_data.csrf_token);
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsubscribe(retries = 5) {
|
function unsubscribe(retries) {
|
||||||
|
if (retries === undefined)
|
||||||
|
retries = 5;
|
||||||
|
|
||||||
if (retries <= 0) {
|
if (retries <= 0) {
|
||||||
console.log('Failed to subscribe');
|
console.log('Failed to subscribe');
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user