mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 16:37:52 +00:00
fix some silly mistakes
This commit is contained in:
parent
c188e6d134
commit
99f8940d38
@ -783,16 +783,16 @@ function openNewUsersModal() {
|
||||
|
||||
var hlist = $('<ol class="follow-suggestions"></ol>')
|
||||
.appendTo(modal.content);
|
||||
var count = 10;
|
||||
var count = 15;
|
||||
|
||||
modal.content.on('scroll', function() {
|
||||
if (modal.content.scrollTop() >= hlist.height() - modal.content.height() - 20) {
|
||||
!getLastNUsers(5, count, modal.self);
|
||||
count += 10;
|
||||
if (getLastNUsers(5, count, modal.self))
|
||||
count += 5;
|
||||
}
|
||||
});
|
||||
|
||||
getLastNUsers(10, 0, modal.self);
|
||||
getLastNUsers(15, 0, modal.self);
|
||||
}
|
||||
|
||||
function openModalUriShortener()
|
||||
|
@ -17,6 +17,7 @@ var _lastSearchUsersResultsRemovedFromDHTgetQueue = true;
|
||||
var _lastLoadFromDhtTime = 0;
|
||||
var _lastProcessedBlock = -1;
|
||||
var knownNewUsers = [];
|
||||
var isNewUserThRunning = false;
|
||||
|
||||
var twisterFollowingO = undefined;
|
||||
|
||||
@ -431,23 +432,34 @@ function followingEmptyOrMyself() {
|
||||
|
||||
function getLastNUsers(n,offset,module) {
|
||||
|
||||
if (isNewUserThRunning)
|
||||
return false;
|
||||
|
||||
isNewUserThRunning = true;
|
||||
for (var i = offset; i < knownNewUsers.length && i < offset + n; i++)
|
||||
processWhoToFollowSuggestion(module, knownNewUsers[i]);
|
||||
|
||||
if (knownNewUsers.length >= n + offset)
|
||||
return;
|
||||
{
|
||||
isNewUserThRunning = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_lastProcessedBlock == -1)
|
||||
requestBestBlock(processBlockUsers, {n: n, offset: offset, module: module});
|
||||
else
|
||||
requestNthBlock(_lastProcessedBlock - 1, processBlockUsers, {n: n, offset: offset, module: module});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function processBlockUsers(block, users){
|
||||
_lastProcessedBlock = block.height;
|
||||
|
||||
if (knownNewUsers.length + block.usernames.length < users.n + users.offset)
|
||||
if (knownNewUsers.length + block.usernames.length < users.n + users.offset && typeof block.previousblockhash !== 'undefined')
|
||||
setTimeout(function(){requestBlock(block.previousblockhash, processBlockUsers, users);}, 100);
|
||||
else
|
||||
isNewUserThRunning = false;
|
||||
|
||||
for (var i = 0; i < block.usernames.length; i++) {
|
||||
if (knownNewUsers.indexOf(block.usernames[i]) == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user