1
Fork 0

e621: stop passing negative values to setTimeout

This commit is contained in:
Conduitry 2020-04-16 06:29:18 -04:00
parent 9acbecc4b7
commit 34f2040178
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ const make_request = (path, params) => new Promise(res => setTimeout(() => {
xhr.open('GET', path + make_query(params), true);
xhr.send();
last_request_time = Date.now();
}, last_request_time + 500 - Date.now()));
}, Math.max(last_request_time + 500 - Date.now(), 0)));
// find all posts matching tags, iterating through pages (only works with the default ordering of decreasing ids)
const find_all_posts = async tags => {