mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Stop fetching when already is fetching
This commit is contained in:
parent
38ff5f2767
commit
112bdcf2d0
@ -8,6 +8,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
var logintimer; // timer to keep track of user inactivity after hitting login
|
var logintimer; // timer to keep track of user inactivity after hitting login
|
||||||
var fetchtimeout; // fetch routine timer
|
var fetchtimeout; // fetch routine timer
|
||||||
|
var currently_fetching; // fetch lock- if true, do not fetch
|
||||||
var last_message_id; // last message tracked
|
var last_message_id; // last message tracked
|
||||||
var selected_channel = guild_id; // user selected channel, defaults to #general channel
|
var selected_channel = guild_id; // user selected channel, defaults to #general channel
|
||||||
var guild_channels = {}; // all server channels used to highlight channels in messages
|
var guild_channels = {}; // all server channels used to highlight channels in messages
|
||||||
@ -200,7 +201,7 @@
|
|||||||
}
|
}
|
||||||
guild_members_arr.sort(function(a, b) {
|
guild_members_arr.sort(function(a, b) {
|
||||||
return parseInt(b.position) - parseInt(a.position);
|
return parseInt(b.position) - parseInt(a.position);
|
||||||
})
|
});
|
||||||
var template_role = $('#mustache_memberrole').html();
|
var template_role = $('#mustache_memberrole').html();
|
||||||
Mustache.parse(template_role);
|
Mustache.parse(template_role);
|
||||||
var template_user = $('#mustache_authedusers').html();
|
var template_user = $('#mustache_authedusers').html();
|
||||||
@ -388,6 +389,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function run_fetch_routine() {
|
function run_fetch_routine() {
|
||||||
|
if (currently_fetching) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currently_fetching = true;
|
||||||
var channel_id = selected_channel;
|
var channel_id = selected_channel;
|
||||||
var fet;
|
var fet;
|
||||||
var jumpscroll;
|
var jumpscroll;
|
||||||
@ -432,6 +437,9 @@
|
|||||||
fetchtimeout = setTimeout(run_fetch_routine, 10000);
|
fetchtimeout = setTimeout(run_fetch_routine, 10000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
fet.always(function() {
|
||||||
|
currently_fetching = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_embed_userchip(authenticated, avatar, username, userid, discrim=null) {
|
function update_embed_userchip(authenticated, avatar, username, userid, discrim=null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user