mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-20 12:41:17 +01:00
Increase the poll_interval_delay when there are no posts
This commit is contained in:
parent
6086bb68aa
commit
dfab94a33c
@ -94,9 +94,15 @@ $(document).ready(function(){
|
||||
|
||||
clearTimeout(poll_interval);
|
||||
|
||||
poll_interval_delay = end_of_page
|
||||
? poll_interval_mindelay_bottom
|
||||
: poll_interval_mindelay_top;
|
||||
// If there are no new posts, double the delay. Otherwise set it to the min.
|
||||
if(new_posts == 0) {
|
||||
poll_interval_delay *= 2;
|
||||
} else {
|
||||
poll_interval_delay = end_of_page
|
||||
? poll_interval_mindelay_bottom
|
||||
: poll_interval_mindelay_top;
|
||||
}
|
||||
|
||||
poll_interval = setTimeout(poll, poll_interval_delay);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user